javascript - jqGrid set URL to custom button -


i have jqgrid in trying implement custom button send request servlet.

so far have done this:

.navbuttonadd('#pager10', {     caption:"activate  ",     buttonicon:"ui-icon-add",     position:"last",     mtype: 'post',     url: 'myservletname',     data: {action: 'activate',custid: function () {return custid;}},     onclickbutton: function()     {          alert("activate "+custid);     }, }); 

above code adds activate button pager , shows alert onclickbutton event. doesn't send request servlet.

so question how should set url custom button in jqgrid.

custom button added navigator bar respect of navbuttonadd allows to execute javascript code when user click on button. can implement any action need. example can use jquery.ajax sent information servlet or assign new value location.href redirect url. if needed can rowid of selected row using code

var rowid = $(this).jqgrid("getgridparam", "selrow"); 

inside of onclickbutton. can implement behavior need.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -