Welcome Guest, Not a member yet? Register   Sign In
Flexigrid - Lightweight but rich data grid

[eluser]justinkelly[/eluser]
Hi Guys,

first - thanks for the great flexigrid!!
- i was starting to use extgrid but this is a nicer option

just a quick question for you guys
- is it possible to set the column width in % rather than px in flexigrid?
- i've had a play around and looked in the flexigrid.js etc. but couldn't see anything

Cheers

Justin

[eluser]TheJayL[/eluser]
Ok I found a major issue with my code. The grid breaks when I include an ajax function that I created. When I reorder the columns: Basically at the end of DragEnd I call my ajax function to store the new column order. Everything seems to look and work fine and my code writes out the sessions vars. If I reload the page it stays the way I left it.

However, if I use any of the grids functions like next page or change the rows per page or show/hide columns (basically anything the grid reloads the data but not the whole page) I get errors in the grid. They all are linked to this one action of mine. The biggest error is that the grid populates, but with the old column order. The headers are still correct, but the actual data is not. So my columns are not matching up. Once I reload, everything looks and operates as it should until I use one of the built in Flexi operations again.

This makes me think either the JS is taking care of managing its own column layout, independent of the XML, or my ajax command is somehow breaking the JS and not allowing it to update itself. Once I take out the Ajax it all works great.

I have also checked the XML after the columns have been reordered and it is correct, and I have "alerted" the column titles after the Grid populates, both are correct. My leaning towards something going haywire in this like of code, but not sure:

td[removed] = $("cell:eq("+ idx +")",robj).text();

Any ideas as to where to look would be great.

[eluser]justinkelly[/eluser]
re [quote author="justinkelly" date="1216643332"]Hi Guys,

first - thanks for the great flexigrid!!
- i was starting to use extgrid but this is a nicer option

just a quick question for you guys
- is it possible to set the column width in % rather than px in flexigrid?
- i've had a play around and looked in the flexigrid.js etc. but couldn't see anything

Cheers

Justin[/quote]

to try and make this work i edited flexigrid.js and changed it from px to % (refer below)
############
line 960 $(thdiv).css({textAlign:this.align, width: this.width + '%'});
############

the outcome of this is that the div widths for the columns now show up as %

grid html
#### TH ####
<th class="sorted" align="center" abbr="id" axis="col0">
<div class="sasc" style="text-align: center; width: 40%;">ID</div>
</th>
#### TD ####
<td class="sorted" align="center">
<div style="text-align: center; width: 40%;">1</div>
</td>

but this didn't work/display correctly - anyone got any suggestions on how to make column % width work?

Cheers

Justin

[eluser]Kevin Kietel[/eluser]
http://speckyboy.com/2008/07/21/20-amazi...resources/

#5: flexigrid

[eluser]tof[/eluser]
hello,
i'm going to use flexigrid for my new programs.
however, i would like to dynamically parse the grid's attributes to add new functions to the grids (printing, csv output, etc).
i've passed the all day trying to get the colModel definition but i didnt succeed.
i want to get the colModel definition, the sortname & sortorder attributes, in javascript, so that i can generate the sql command coresponding to the user choices once he had played with the grid appearance...
maybe someone here can help me ?

[eluser]dave_in_chapelhill[/eluser]
Very nice datagrid! My compliments. Two issues, tho - one I can solve, one I'm having trouble with:

1) In the demo and on one place in flexigrid.js, you refer to showTableToggleBtn. Most places refer to - what I assume is the same thing - with showToggleBtn. I changed the reference within flexigrid.js, and set showToggleBtn parameter in setup call (to false).

2) Semi-related...I didn't want the showToggleBtn (checkboxes for columns, if I'm correct), and thus turned off showToggleBtn by setting it to false. However, this triggers a JS error. In Firebug, when I hover over a column heading (and the button would normally appear), I get:
Node cannot be inserted at the specified point in the hierarchy" code: "3
[Break on this error] this.appendChild( a );

Everything still works regardless, but I wish I could get rid of these errors...Ideas, Paulo?
Thanks -

[eluser]dave_in_chapelhill[/eluser]
In reply to my own prior post...

Apparently, showTableToggleBtn and showToggleBtn are distinct. Thus, there should be a showTableToggleButton default in parameters at top of flexigrid.js.

Further, to address the JS error mentioned when hover over header column name when showToggleBtn is false:
Node cannot be inserted at the specified point in the hierarchy" code: "3
[Break on this error] this.appendChild( a );

I fixed this, tho probably not optimally, by two edits in flexigrid.js:

Comment out/change:
Code:
//            if (p.showToggleBtn) $(g.gDiv).prepend(g.nBtn);
            $(g.gDiv).prepend(g.nBtn);

Wrap an 'if' around hover processing:
Code:
if (p.showToggleBtn) // DLC patch
{
  (g.nDiv).hide();$(g.nBtn).hide();
  $(g.nBtn).css({'left':nl,top:g.hDiv.offsetTop}).show();
  var ndw = parseInt($(g.nDiv).width());
  $(g.nDiv).css({top:g.bDiv.offsetTop});
  if ((nl+ndw)>$(g.gDiv).width())
    (g.nDiv).css('left',onl-ndw+1);
  else
    $(g.nDiv).css('left',nl);
  if ($(this).hasClass('sorted'))
    $(g.nBtn).addClass('srtd');
  else
    $(g.nBtn).removeClass('srtd');
}

[eluser]Armorfist[/eluser]
[quote author="justinkelly" date="1216701279"]re [quote author="justinkelly" date="1216643332"]Hi Guys,

first - thanks for the great flexigrid!!
- i was starting to use extgrid but this is a nicer option

just a quick question for you guys
- is it possible to set the column width in % rather than px in flexigrid?
- i've had a play around and looked in the flexigrid.js etc. but couldn't see anything

Cheers

Justin[/quote]

to try and make this work i edited flexigrid.js and changed it from px to % (refer below)
############
line 960 $(thdiv).css({textAlign:this.align, width: this.width + '%'});
############

the outcome of this is that the div widths for the columns now show up as %

grid html
#### TH ####
<th class="sorted" align="center" abbr="id" axis="col0">
<div class="sasc" style="text-align: center; width: 40%;">ID</div>
</th>
#### TD ####
<td class="sorted" align="center">
<div style="text-align: center; width: 40%;">1</div>
</td>

but this didn't work/display correctly - anyone got any suggestions on how to make column % width work?

Cheers

Justin[/quote]

Did anyone figure this out? I'm trying to do this too but without success. Getting really frustrated Tongue
Thanks

[eluser]Armorfist[/eluser]
Oh and paulo:

In the next release can you include the string "Quick Search" and "Clear" from the search box feature as a property like "pagestat"?
I have to manually change this in every release

Thanks!

[eluser]Wallcrawler[/eluser]
Hi guys!

First of all, flexigrid is a superb jquery plugin!

But i´m facing some troubles to get it work perfectly.

Please see the page http://www.goldmaxbrasil.com.br/desenvol...itacao.asp, and click in "mostrar" button.

The flexgrid is shown, but the margin of each header didn't match with the rows. If you access this page using IE7 more visual problems is shown. What have i done wrong?

Otherwise, how can i put a function to be executed when the user select one row?

Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB