I’m wondering if its possible to make a flexigrid thats based on a table column sortable? Is that possible? How/where do I add those options?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
March 28, 2008 10:13am
Subscribe [82]#541 / Aug 01, 2008 6:05am
I’m wondering if its possible to make a flexigrid thats based on a table column sortable? Is that possible? How/where do I add those options?
#542 / Aug 03, 2008 5:22am
Paulo:
is there any rss feed so that when you update the flexigrid, we can get the news 😊 [ instead of visiting this forum everyday ] 😉
#543 / Aug 03, 2008 9:54am
Paulo:
is there any rss feed so that when you update the flexigrid, we can get the news 😊 [ instead of visiting this forum everyday ] 😉
Do you mean the RSS 2.0 button in the page footer? (or the RSS icon in the address bar - depends on your browser).
#544 / Aug 04, 2008 8:42am
Hi there!
I dont know if anybody already “solved” this problem I have…
Does anybody know how to add checkboxes to this grid with storing the selected values while paging?
I mean when you select some checkboxes on page 1 and then go further to page 2, select boxes there AND THEN switch back to page 1: all before selected boxes should be selected again…
something like here… but I unfortunately cannot transfer this to flexigrid… :((
http://www.sigmawidgets.com/products/sigma_grid2/demos/example_checkbox_paging.html
anybody an idea?
would be a very great feature to flexigrid with combining to form usage.
bye,
marcd
#545 / Aug 04, 2008 9:34pm
Hi guys,
I didn’t really design flexigrid to use % sizes as the dragndrop and resizing functions are dependent on accurate per pixel measurements.
Paulo
Thanks for the reply Paulo
its more of an visual appeal factor - i use 100% width grid for my project and having columns in px will leave a blank space in the grid on a larger screen (which doesn’t look to nice)
from what i can remember open rico grid does some funky % -> px calculation based on grid size to handle resize etc and columns based on %
question: is there an easy way to find the px width of a flexigrid? - if so then i can look at writing a % -> px type conversion type
If anyone else has any suggestions i would appreciate hearing them
Cheers
Justin
Hello Justin,
This is actually very simple:With jquery COOKIE plugin, I retrieve the screen resolution width and store it in a cookie:
[removed] $(document).ready(function() { $.cookie('scrres', screen.width); }); [removed]Then with PHP all you have to do is get that cookie and calculate the column size based on the percentage.
function calculate_column_size($column_size) { $screen_res = get_cookie('scrres'); //This is a codeigniter function from the "cookie" helper if ($screen_res != FALSE) $usable_screen = ($screen_res); else $usable_screen = (1024); //Default resolution return ($column_size*($usable_screen/100)); //Calculate in pixels and return }You also can probably do this with javascript only.
Hope it helps!Thanks Armorfist!
I will give this a go
Cheers
Justin
just an update
- i got this working by using the jquery dimensions (http://brandonaaron.net/docs/dimensions/) plugin
var grid_width = $('.col').width();where .col if the class of the div that the grid is in
then use do some maths on grid_width and put the resulting variables in the col_width section in the colModel
Thanks again!!
note: flexigrid will now be the grid used in Simple Invoices (http://www.simpleinvoices.org) replacing the original open rico grid and thankfully replacing the need for extjs grid (i had converted most grids to extjs but this is much nicer and smaller!!)
Cheers
Justin
#546 / Aug 05, 2008 7:40pm
Nice! Thanks
#547 / Aug 07, 2008 5:00am
Hi Marcd,
Hmmm, I’m having the same issue. To get the checkboxes working, I added an onclick() to them and the handler will add the checkbox’s ID to a global array. btw, to get to the same checkboxes from your functions, you need to use $(‘input#the-id’), as $(’#the-id’) wouldn’t work for me. And in case anyone reading along is as new to javascript as I, use .parent() (maybe more than once) to apply a class styling to a row.
I don’t know how to get a call back for after the reload. I believe that the row is written near line 480, so if anything, maybe I’ll hack another parameter for my external function to manipulate the row. ??
I would definitely appreciate some direction if anyone has ideas.
Thanks!
Chris
Hi there!
I dont know if anybody already “solved” this problem I have…
Does anybody know how to add checkboxes to this grid with storing the selected values while paging?
I mean when you select some checkboxes on page 1 and then go further to page 2, select boxes there AND THEN switch back to page 1: all before selected boxes should be selected again…
something like here… but I unfortunately cannot transfer this to flexigrid… :((
http://www.sigmawidgets.com/products/sigma_grid2/demos/example_checkbox_paging.html
anybody an idea?
would be a very great feature to flexigrid with combining to form usage.bye,
marcd
#548 / Aug 07, 2008 6:59am
Hi there!
I dont know if anybody already “solved” this problem I have…
Does anybody know how to add checkboxes to this grid with storing the selected values while paging?
I mean when you select some checkboxes on page 1 and then go further to page 2, select boxes there AND THEN switch back to page 1: all before selected boxes should be selected again…
something like here… but I unfortunately cannot transfer this to flexigrid… :((
http://www.sigmawidgets.com/products/sigma_grid2/demos/example_checkbox_paging.html
anybody an idea?
would be a very great feature to flexigrid with combining to form usage.
bye,
marcd
I’m also trying to do this but without success. If anyone has an idea please share.
#549 / Aug 07, 2008 9:10am
Hi!
Well, I managed to add a form element like checkbox or radio button.
I added at post.php in JSON Part my checkbox function:
$json .= "cell:['<input type=\"checkbox\" name=\"checkbox[]\" value=\"".$row['NAME']."\"/>','".$row['ROW']."','".$row['NAME']."'";with this and an this line in colModel at index.php:
{display: 'BOX',name: 'check', width : 40, sortable : true, align : 'center'},I can show the checkbox.
When adding a form tag in HTML part I can post this values.
But I still cannot store checkbox values when paging. selected checkboxes are unselected after clicking “forward” / “backward”. cross postback does not work and I have no idea how to implement this.
Anyone an idea????
bye,
marc
Hi there!
I dont know if anybody already “solved” this problem I have…
Does anybody know how to add checkboxes to this grid with storing the selected values while paging?
I mean when you select some checkboxes on page 1 and then go further to page 2, select boxes there AND THEN switch back to page 1: all before selected boxes should be selected again…
something like here… but I unfortunately cannot transfer this to flexigrid… :((
http://www.sigmawidgets.com/products/sigma_grid2/demos/example_checkbox_paging.html
anybody an idea?
would be a very great feature to flexigrid with combining to form usage.
bye,
marcdI’m also trying to do this but without success. If anyone has an idea please share.
#550 / Aug 07, 2008 3:42pm
When you say one page, you mean one physical page of paper, or do you mean one page like the pager?
If its one page, as in the pager, then the query is still using LIMITED, or it is not using the new data, but the data the list was created with.
One page of the physical paper. All data on my table displays in one page of the grid (I don’t have to click next page). But when I print, only the portion that is on the first page printed. I hope I explained that well.
Add this to your html
<style media="print"> .bDiv { height: auto !important; } </style>Let me know if it helps.
Sorry for the late reply but that did not work either. I have about 500 record to show on the table. The table displays find, but printout was cut off at the section that would fit a physical page.
#551 / Aug 08, 2008 6:31am
Thanks for your work.
I integrate it on my site : Flexigrid
#552 / Aug 10, 2008 5:55pm
Thanks Paulo!
Thank you guys, keep up the good work!
#553 / Aug 11, 2008 7:42am
I’m trying to use Flexigrid with jsp to implement the example 3. I’m not able to retreive the sortname, rp, etc., kind of flexigrid attributes in my jsp code to hit the database.
How to get it?
#554 / Aug 11, 2008 1:41pm
^^^^^
set to Post data.
in PHP:
$_POST[‘sortname’]
$_POST[‘rp’]
$_POST[‘page’]
$_POST[‘query’]
$_POST[‘page’]
etc
#555 / Aug 12, 2008 1:00am
I’m not using PHP. How to get these attributes in JSP?