jqgrid定制操作将数据发布到服务器 [英] jqgrid custom action POST data to the server
问题描述
试图查看文档,但找不到.
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-arrowthick-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)
}
});
我们将不胜感激!
推荐答案
如果您比较如果用户单击编辑"按钮将执行的代码(请参见onClickButton .trirand.com/jqgridwiki/doku.php?id = wiki:custom_buttons"rel =" nofollow noreferrer> navButtonAdd ,您将看到应该做什么.您只需要获取当前选定行selrow
(或选定行selarrrow
)的rowid,然后执行所需的操作即可.要将任何信息发送到服务器,您可以使用 jQuery.ajax .要获取包含该行的行,可以使用 getRowData 例如.参见此 此处详细信息的旧答案.
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.
这篇关于jqgrid定制操作将数据发布到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!