开发者

jqgrid custom action POST data to the server

开发者 https://www.devze.com 2023-03-20 00:24 出处:网络
tried looking in the documentation but could not find. Is there a way in which i can do a post to the server using custom button and not invoke a edit/add screeen?

tried looking in the documentation but could not find.

Is there a way in which i can do a post to the server using custom button and not invoke a edit/add screeen?

jQuery("#mytreegrid").jqGrid('navButtonAdd',"#ptreegrid", 
   {caption:"",title:"Move Up", buttonicon :'ui-icon-arrowth开发者_StackOverflowick-1-n', 
     onClickButton:function(){ 
      // calling something similar to onclickSubmit where i can construct 
      // my post body or set urls like onclickSubmit: function(rp_ge, postdata)  
    }
});

Help will be much appreciated!


If you compare the code which will be executed if the user click on the "Edit" button (see here) with onClickButton of the navButtonAdd you will see what you should do. You need just get the rowid of the current selected row selrow (or selected rows selarrrow) and do what you need. To send any information to the server you can use jQuery.ajax. To get the row contain of the row you can use getRowData for example. See this this and here old answers for detailes.

0

精彩评论

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