Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Session death with multiple grids
06/01/2010
20:34
Avatar
Darren
Guest
Guests

I have three grids that load on the page (A, B, and C).  A points to B and C.

On the inital load all three grids attempt to load, but this causes the PHP session to become lost.  Is there any way to add a delay to the ajax calls or a queue perhaps?

07/01/2010
20:34
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Try to implemet the following logic for the 3 grids:

Create the grid initiallly with datatype local and then set the data type to json and trigger with setTimeout - i.e.

$("#grid").jqGrid({

...

datatype:'local',

...

});

$("#grid").jqGrid('setGridParam',{datatype:'json'});

setTimeout(function(){$("#grid").trigger("reloadGrid")}, 100 );

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

13/01/2010
07:38
Avatar
Darren
Guest
Guests

Sorry for my delayed response on this (and thank you for your assistance!) –

It appears that setting this up like so :

jQuery(document).ready(function(){
     jQuery(”#grid”).jqGrid({
     –

           datatype:'local',
     –

     });

     $(”#grid”).jqGrid('setGridParam',{datatype:'json'});

     setTimeout(function(){$(”#grid”).trigger(”reloadGrid”)}, 100 );

});

renders the script inoperable (no grid appears).

Firebug reports :

illegal character

jQuery(”#grid”).jqGrid('setGridParam',{datatype:'json'});

13/01/2010
19:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I'm not sure that this is a jqGrid problem

Could you please provide a link to the problem?

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

20/01/2010
20:59
Avatar
Darren
Guest
Guests

Ok — the code works.

I had ” instead of “, which Firefox at least was reading as an error.  Thanks again for the assistance.

20/01/2010
23:11
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

Just as a note, I have 5 grids on one page in a particluar instance with no issues. When you select a row on the first grid (onSelectRow) it calls the other 4 grids and loads their data. Each one of these grids suports editing and require lookup data (drop downs) in the form edit mode so I get the data within each grids declaration with the jQuery ajax call and am sure to use the

async: false

property, which ensures that each grid is loaded without overlapping sessions or threads.

On another note Darren, I keep the previous value of the number of rows per page on my server (Mvc app) and when it posts back for any reason I check to see if the number of rows per page has chnaged, and if so, send them back to page 1. However, I was using a sessions variable MyjqGridRowsPerPage and since I have many grids on the same page will need to create a different one for every grid, seems like a lot of work, how did you handle this situation with the user changing the number of rows per page? Tony do you have any suggestions?

22/01/2010
04:50
Avatar
Jeff
Guest
Guests

Tony,

I wonder about using id's in a case like this at all… seems like the template should never have id's, in the case where I want to reuse the same template on the same page (imagine a desktop with instances of a grid class, all having a template with a repeated id). This won't work, simple DOM rules.

I've been using:

$(.classname)[0]  or $(.classname).jqGrid

but it only works the first time to instantiate the grid, but I can't use it get a handle to the grid later to use it to modify the grid dynamically.

I realize this puts several elements on a page with the same classname, but I can use the windowing system to contexualize the search to the current context of my widget's window (window framework) like this:

$(”table.scroll”, this.$content)    <– jquery allows second item, to scope search to current context, thus 1 element is returned

I did an inspect and see that the grid resets the class name to .ui-jqgrid-btable.  I use that, and it works…

is this sanctioned to use to get a handle to the grid or is there a better way? Should I put the grid in a var and refer to the var instead? Of course I'll have to declare the var high enough up that I can get to it at the page level WITHOUT having a handle to the grid to get it..

I've searched and searched, I don't see ANY examples in the docs that deal with this and I don't see the subject discussed, but web 2.0 is all about avoiding IDs when possible to avoid DOM conflicts, and possibly the reason this person has a problem, if they repeat id's on the page.

25/01/2010
22:26
Avatar
ajax head
Guest
Guests

jqGrid is also inserting duplicate id's when two grids are on the same page for me.

I'm very surprised by this, not sure what to think. I've seen it do different things on different days so it could be somewhat dependant on how I have the page organized, but looks like this: 

2 instances of the same grid on the page, both using the same template to get the grid on the page, using NO ID's:

'<table class="scroll" cellpadding="0" cellspacing="0"></table>'

then I have two grids added to the page. It works fine with duplicate ids in FFox but blows up on IE7...

I see this for both grids in the DOM with Firebug:

<div style="width: 625px;" id="gview_" class="ui-jqgrid-view"></div>

<div style="display: none;" class="loading ui-state-default ui-state-active" id="load_">Loading...</div>

<div class="ui-widget-overlay jqgrid-overlay" id="lui_">

Not positive but I think this is why 2 grids are not working on the same page for me, in IE7. Maybe there is an option I've overlooked I should be setting, or maybe this is a bug that needs to be fixed because I'm using the grid in a factory that is adding instances of the same grid to the page?

I'd probably prefer to avoid IDs altogether, and short of that be able to set some kind of configuration param that will help me know what ids I can expect for each instance of the grid on a given page.

thx, Jeff-

26/01/2010
18:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Setting id is recommended for proper work. Also you can generate your own id using random generator. The fasted way to every dom manipulation is to query it by ID.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

23/02/2010
20:33
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

Just as an example, the page with multiple grids on the page I have defined as such:

            <div id="deliveredWrapper">
                <table id="ListDeliveredVP" class="scroll" cellpadding="0″ cellspacing="0″></table>
                <div id="ListDeliveredVPPager" class="scroll" style="text-align:center;"></div>
            </div>

            <div id="deliveredVPRecontactWrapper">
                <table id="ListDeliveredVPRecontact" class="scroll" cellpadding="0″ cellspacing="0″></table>
                <div id="ListDeliveredVPRecontactPager" class="scroll" style="text-align:center;"></div>
            </div>

            <div id="deliveredProofsWrapper">
                <table id="ListDeliveredVPProofs" class="scroll" cellpadding="0″ cellspacing="0″></table>
                <div id="ListDeliveredVPProofsPager" class="scroll" style="text-align:center;"></div>
            </div>

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
71 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information