开发者

Submit user data jqgrid

开发者 https://www.devze.com 2023-03-06 09:19 出处:网络
I\'m try to return grid data based on the parameter I send, I added new button to my grid : jq(\"#grid\").navButtonAdd(\'#pager\',

I'm try to return grid data based on the parameter I send, I added new button to my grid :

jq("#grid").navButtonAdd('#pager',
                                {  caption:"Get Only The Latest Data(Ignores old)", 
                                 buttonicon:"ui-icon-plus", 
                                 onClickButton: setUniqueValue,
                                 position: "last", 
                                 title:"", 
                                 cursor: "pointer"
                                } 
                              );

I have hidden element span with the value false at the initial grid/page load, and I set it to true w开发者_Python百科hen this above button is clicked :

function setUniqueValue(){
                            jq("#unique").text("true");
                            jq("#grid").trigger("reloadGrid");
                        }

So I'm sending this value to the server trough postData: {latest : jq("#unique").text()},

But this has always the same initial value false, I mean this has to be possible? Because that is how the search works, its false at the begining then when you click on the query submit its set to true or something like that, anybody knows how to do this?


I can't follow what you exactly want to do, but you should change the definition of latest property of postData to the following:

postData: { latest: function() { return jq("#unique").text(); } }
0

精彩评论

暂无评论...
验证码 换一张
取 消