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
save grid parameters and set them at each grid loading
03/06/2011
09:13
Avatar
rochiel
France
Member
Members
Forum Posts: 20
Member Since:
26/05/2010
sp_UserOfflineSmall Offline

Hello all,

I've saved and set any parameters as :

 - rows, page, sortname and order

 - grid toolbar filters

I can set them but not after grid construction because grid is loading with their own default parameters.

I can set them thank to a button who call this function :

var gridprefs = prefs.load();
    var grid = jQuery("#conditioning_factor_table");
    if(gridprefs["params"] != undefined){        
        for(var i in gridprefs['params']){
            if(i == 'sortname'){
                grid.jqGrid('setGridParam', {'sortname': gridprefs['params'][i]});
            }else if(i == 'sord'){
                grid.jqGrid('setGridParam', {'sortorder': gridprefs['params'][i]});
            }else if(i == 'rows'){
                grid.jqGrid('setGridParam', {'rowNum': gridprefs['params'][i]});
                $("#conditioning_factor_table_toppager_center select option[value='" + gridprefs['params'][i] + "']").attr("selected", true);
            }else if(i == 'page'){
                grid.jqGrid('setGridParam', {'page': gridprefs['params'][i]});
            }
        }        
    }
    if(gridprefs["filters"] != undefined){
        $("[id^=gs_]").each(function(index) {
            $(this).val(gridprefs['filters'][$(this).attr('id')]);
            $(this).change();
        });        
    }
    grid.jqGrid('setGridParam', {'_search': true});
    grid.trigger("reloadGrid");

I would like set these parameters at first grid loading. Solutions (?) :

- disable grid loading, set grid parameters and reloadGrid => How disable grid reload and enable after saved parameters have setted ?

- set these parameters after construction but before grid first loading : there are events who allow that ?

If anyone have the solution i'll take it 🙂

Thank in advance for your help and Thank to Tony for this great Plugin 😀

03/06/2011
16:12
Avatar
rochiel
France
Member
Members
Forum Posts: 20
Member Since:
26/05/2010
sp_UserOfflineSmall Offline

I tried beforeRequest with boolean tag (firstLoad).

if it's the first load, it call function described in next thread without reload grid.

The problem is no parameters has been setted in that case :s

Any suggestion ? ^^

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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