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_Related Related Topics sp_TopicIcon
jqGrid.LiveGrid ?
21/10/2010
12:16
Avatar
jwinns
Member
Members
Forum Posts: 16
Member Since:
30/08/2010
sp_UserOfflineSmall Offline

Hi, I  Tryin' to make some kind of LiveGrid, loading data from JSON source.
It seems there is no built in Solution for refreshing the Grid on an given Interval?

So i do it like that:
var refreshgrid = setInterval(function() {        jQuery("#%(id)s").jqGrid().trigger("reloadGrid");    }, 5000);

But there are a few Problems going like that:

1. After loadComplete the last selected row isn´t selected anymore - How can I restore the last selected row after every reload?

2. It seems that the Grid-data is flushed, before the same data is read in again(Grid flares on reload) - How can achieve, that only the changed fields(if any) will be replaced(at an given Interval)?

Thanks in advance.

JAY

21/10/2010
15:16
Avatar
jwinns
Member
Members
Forum Posts: 16
Member Since:
30/08/2010
sp_UserOfflineSmall Offline

@1: If I  set the refreshstate:"current" :

.jqGrid('navGrid','#%(id)s_pager',{refreshstate:"current"})

and then press the refresh-button in the Navigator, it works as expected(last selected row stays selected).

So I need to know how to make an "refresh" with refreshstate:"current" on an Interval...

Can anyone help?

21/10/2010
15:48
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello!

You should use    

$("#list").trigger("reloadGrid", [{current:true}]);

to do this (see for example my old answer on the stackoverflow.com about this).

Best regards
Oleg 

21/10/2010
16:02
Avatar
jwinns
Member
Members
Forum Posts: 16
Member Since:
30/08/2010
sp_UserOfflineSmall Offline

OlegK said:

Hello!

You should use    

$("#list").trigger("reloadGrid", [{current:true}]);

to do this (see for example my old answer on the stackoverflow.com about this).

Best regards
Oleg 


Thanks, I came up with this one too, found @jqGrid.min.js.

Can anybody help with 2. Replacing only fields, which changed on Server? Or put me in the right direction where to start?

Thanks.

Jay

21/10/2010
16:26
Avatar
jwinns
Member
Members
Forum Posts: 16
Member Since:
30/08/2010
sp_UserOfflineSmall Offline

OlegK said:

Hello!

You should use    

$("#list").trigger("reloadGrid", [{current:true}]);

to do this (see for example my old answer on the stackoverflow.com about this).

Best regards
Oleg 


Next one commin`in:

Everything works just fine with:

$("#list").trigger("reloadGrid", [{current:true}]);

until I do:

scroll: true,

After every reload the Grid jumps back to the Records 1-20 and if i have scrolled down and selected for Example record 15, It won´t work because it jumps back to Records 1-20 and no record is selected.

How can I achieve that the Grid stays in the last selected range of Records f.E. 20-30 and keeps the selected Record?

Thanks.

21/10/2010
16:33
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Jay,

I am not sure that I understand you correct. Do you use reloadAfterSubmit:false? I change some default values with

jQuery.extend(jQuery.jgrid.edit, {
     // some other settings
    closeAfterAdd: true,
    closeAfterEdit: true,
    recreateForm: true,
    reloadAfterSubmit: false
});

Best regards

Oleg 

21/10/2010
16:56
Avatar
jwinns
Member
Members
Forum Posts: 16
Member Since:
30/08/2010
sp_UserOfflineSmall Offline

OlegK said:

Hi Jay,

I am not sure that I understand you correct. Do you use reloadAfterSubmit:false? I change some default values with

jQuery.extend(jQuery.jgrid.edit, {
     // some other settings
    closeAfterAdd: true,
    closeAfterEdit: true,
    recreateForm: true,
    reloadAfterSubmit: false
});

Best regards

Oleg 


I don´t use grid edit. I´ve got an Server-side Process running which is feeding the DB and on the client-side JQgrid frequently reads the DB per JSON.

And now erverything is working fine except if I set the Grid to:

scroll: true,

then after every reload, the Grid jumps to Records 1 -20(wont stay at last scrolled, Example 20-30), the grid wont select "current" if selected is above 20 and the Grid is shortly cleared bevore the Records are inserted again(@2.)

JAY

21/10/2010
17:14
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

I wrote before, that I was not sure what I understood you correct, but till now I don't really understand what you want to achieve.

With scroll:true I have no experience because I don't use it in my programs. Probably other persons can help you.

If you get the data from the server you use probably the paging of data, so only one page of data should be reloaded. Because the data can be also changed from another users of the database any optimization of the data loading can be done only on the server side. For example you can implement different caching of data (see this my old answer for example for additional information). In the case the data (the page) will be not transfered one more time and only revalidated.

Best regards
Oleg 

21/10/2010
20:24
Avatar
jwinns
Member
Members
Forum Posts: 16
Member Since:
30/08/2010
sp_UserOfflineSmall Offline

OlegK said:

I wrote before, that I was not sure what I understood you correct, but till now I don't really understand what you want to achieve.

With scroll:true I have no experience because I don't use it in my programs. Probably other persons can help you.

If you get the data from the server you use probably the paging of data, so only one page of data should be reloaded. Because the data can be also changed from another users of the database any optimization of the data loading can be done only on the server side. For example you can implement different caching of data (see this my old answer for example for additional information). In the case the data (the page) will be not transfered one more time and only revalidated.

Best regards
Oleg 


Hi Oleg,

In the case the data (the page) will be not transfered one more time and only revalidated.

Thats exactly what I would like to do, setting

prmNames: { nd:null} can easily be done, but I don´t know how to implement

Cache-Control: max-age=0 and ETag.... I am using WEB2PY as Backend.

But I think I can´t implement that without your help.

For now the Solution:

$("#list").trigger("reloadGrid", [{current:true}]);

works, but as I said only if:

scroll: true,

is not set! Then the reload of the Grid is visible to the user(it is shortly empty, before the data is loaded again),

and there are issues with the scrolling, I´ve explained above.

Can anybody help me up with this?

Thanks for the effort till now Oleg.

JAY

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
41 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