Part of the EllisLab Network
   
49 of 62
49
Flexigrid - Lightweight but rich data grid
Posted: 21 July 2008 09:41 AM   [ Ignore ]   [ # 481 ]  
Summer Student
Total Posts:  18
Joined  06-13-2008

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.

Profile
 
 
Posted: 21 July 2008 06:34 PM   [ Ignore ]   [ # 482 ]  
Summer Student
Total Posts:  5
Joined  07-21-2008

re

justinkelly - 21 July 2008 02:28 AM

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

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

Profile
 
 
Posted: 22 July 2008 05:47 AM   [ Ignore ]   [ # 483 ]  
Summer Student
Total Posts:  22
Joined  04-01-2008

http://speckyboy.com/2008/07/21/20-amazing-jquery-plugins-and-65-excellent-jquery-resources/

#5: flexigrid

 Signature 

jLorem - A Lorem Ipsum Plugin for jQuery

Profile
 
 
Posted: 22 July 2008 10:14 AM   [ Ignore ]   [ # 484 ]  
Summer Student
Total Posts:  3
Joined  07-22-2008

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 ?

Profile
 
 
Posted: 22 July 2008 09:32 PM   [ Ignore ]   [ # 485 ]  
Summer Student
Total Posts:  2
Joined  07-22-2008

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 -

Profile
 
 
Posted: 22 July 2008 10:50 PM   [ Ignore ]   [ # 486 ]  
Summer Student
Total Posts:  2
Joined  07-22-2008

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:

//            if (p.showToggleBtn) $(g.gDiv).prepend(g.nBtn);
            $(g.gDiv).prepend(g.nBtn);

Wrap an ‘if’ around hover processing:

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');
}

Profile
 
 
Posted: 23 July 2008 10:01 AM   [ Ignore ]   [ # 487 ]  
Grad Student
Avatar
Rank
Total Posts:  88
Joined  10-18-2007
justinkelly - 21 July 2008 06:34 PM

re

justinkelly - 21 July 2008 02:28 AM
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

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

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

 Signature 

Eye View Design - Design Studio
CI FlexiGrid - FlexiGrid on CI Implementation

Profile
 
 
Posted: 23 July 2008 10:23 AM   [ Ignore ]   [ # 488 ]  
Grad Student
Avatar
Rank
Total Posts:  88
Joined  10-18-2007

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!

 Signature 

Eye View Design - Design Studio
CI FlexiGrid - FlexiGrid on CI Implementation

Profile
 
 
Posted: 23 July 2008 09:03 PM   [ Ignore ]   [ # 489 ]  
Summer Student
Total Posts:  3
Joined  07-23-2008

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/desenvolvimento/sisfinanceiro/lanc_financ/contas_pagar_quitacao.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!

Profile
 
 
Posted: 24 July 2008 03:20 AM   [ Ignore ]   [ # 490 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  164
Joined  04-23-2007
Armorfist - 23 July 2008 10:01 AM
justinkelly - 21 July 2008 06:34 PM

re

justinkelly - 21 July 2008 02:28 AM
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

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

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

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

 Signature 

A Better and more Flexible Paging Solution for CI
Automatic config[base_url]

Profile
 
 
   
49 of 62
49
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 61066 Total Logged-in Users: 30
Total Topics: 73887 Total Anonymous Users: 1
Total Replies: 398541 Total Guests: 320
Total Posts: 472428    
Members ( View Memberlist )
Newest Members:  KarnadvdconsultingindispusTelder4336dudeami0Dale-M Moeen uddinbnolenstanjadebieSan2k