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
substitute for triggerToolbar in the new API
03/11/2010
15:33
Avatar
Kelio
Member
Members
Forum Posts: 5
Member Since:
03/11/2010
sp_UserOfflineSmall Offline

hi,

Thanks you very much for the great JqGrid !

I want the grid be already filtered when my page is loaded.

Then I want to use the triggerToolbar function but its don't work with new api.

So what is the substitue of that function in new api ?

or how to use the older api instead ?

Thanks you very much

03/11/2010
16:31
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

All functions inclusive triggerToolbar should works with new API. Do you try with

jQuery("#grid_id").jqGrid('filterToolbar',options);

where "grid_id" is the id of the table element of your grid? If this not work, then you should verify your JavaScript code or at least paste the code example in your question which can be used to reproduce your problem.

Best regards
Oleg 

03/11/2010
17:20
Avatar
Kelio
Member
Members
Forum Posts: 5
Member Since:
03/11/2010
sp_UserOfflineSmall Offline

Thansk for your answer.

I use this code :

<table id="idt-1"></table>

<div id="filter" style="margin-left:30%;display:none">filtre de recherche</div>
       
<script type="text/javascript">
   var mygrid = jQuery("#idt-1").jqGrid({
     url:"loaddata.php",
      datatype: "json",
     height:"auto",
     colNames:[ "firstname","nickname","country"],
     colModel:[  {name:"firstname",index:"firstname", width:75, sorttype:"text",classes:"cssfirstname",stype:"select", editoptions:{value:":All;John:John;Edward:Edward;Oliver:Oliver"}},
                        {name:"nickname",index:"nickname", width:75, sorttype:"text", align:"center",search:false}},
                        {name:"country",index:"country", width:110, sorttype:"text", align:"center",stype:"select", editoptions:{value:"USA:USA;:All;FRANCE:FRANCE;SPAIN:SPAIN"}},
                    ],
     mtype: "GET",
     sortname: "nickname",
     rowNum:500,
     rowTotal: 500,
     loadonce:true,
     viewrecords: false,
      rownumbers: true,
     sortorder: "desc",
     shrinkToFit:true,
     gridview:true,
     caption: "test"
      });

     jQuery("#idt-1").jqGrid("filterToolbar");    
    
    var sgrid = $("#idt-1")[0];
    sgrid.triggerToolbar();       
    
</script>

Thanks you very much

Best regards

03/11/2010
19:00
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

You are right. There methods triggerToolbar, clearToolbar and toggleToolbar are really implemented in another way. It is documented by the way here. Do you have some conflicts? Why it is a problem to you the method triggerToolbar in the way like you as currently do?

By the way your code have a small error: one additional '}' after the declaration of the column "nickname". You should has

    {name:"nickname",index:"nickname", width:75, sorttype:"text", align:"center",search:false}, 

instead of

    {name:"nickname",index:"nickname", width:75, sorttype:"text", align:"center",search:false}}, 

Best regards
Oleg 

06/11/2010
18:04
Avatar
Kelio
Member
Members
Forum Posts: 5
Member Since:
03/11/2010
sp_UserOfflineSmall Offline

Hi, Thanks you very much for your answer.

In fact, I want to load my page with the filter USA:USA already activated.

I try both call to API :

1.   jQuery("#idt-1″).jqGrid("filterToolbar");    and

2.   jQuery("#idt-1").filterToolbar();

follow by

var sgrid = $("#idt-1″)[0];
sgrid.triggerToolbar();   

In both case, my page is not filtered.

In the drop down select list, I have USA:USA by defaut but the data are not filtered on first print.

The most stange things is that when i use local data , the sgrid.triggerToolbar();    works and my page is filtered but when i use JSON, the methods don't work.

Thanks you by advance for your help.

11/11/2010
10:32
Avatar
Kelio
Member
Members
Forum Posts: 5
Member Since:
03/11/2010
sp_UserOfflineSmall Offline

Hi,

this syntax :

I try both call to API :

1.   jQuery("#idt-1″).jqGrid("filterToolbar");    and

2.   jQuery("#idt-1″).filterToolbar();

follow by

var sgrid = $("#idt-1″)[0];
sgrid.triggerToolbar();  

Both syntax don't work with Json.

How can I do to execute the filter after the page is loaded ?

Thanks you very much for your help

11/11/2010
12:23
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello!

If you want to open to set and trigger the filter in the toolbar you can do the same as I described in the answer on the stackoverflow. Do the demo what you want?

Another old answer (see the demo from the answer),  this and this about the role of postData for any kind of searching could be probably also helpfull for you.

Best regards
Oleg

14/11/2010
18:27
Avatar
Kelio
Member
Members
Forum Posts: 5
Member Since:
03/11/2010
sp_UserOfflineSmall Offline

OlegK said:

Hello!

If you want to open to set and trigger the filter in the toolbar you can do the same as I described in the answer on the stackoverflow. Do the demo what you want?

...

Best regards
Oleg


Hi OlegK,

The first example is perfect for me and it's work fine.

THANKS YOU VERY MUCH FOR YOUR HELP.

JqGrid is a great tool.

Best regards,

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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