JQGrid设置不同的URL以进行添加,编辑,删除 [英] JQGrid Setting different URLs for add,edit,delete

查看:339
本文介绍了JQGrid设置不同的URL以进行添加,编辑,删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网格顶部添加三个按钮以进行添加,编辑,删除. 并希望为每个操作调用单独的URL.为此,我想使用表单编辑". 谁能建议我一个示例代码.

I want to add three buttons on top of the grid for add,edit,delete. And want to make calls to separate URLs for each of the operation.I want to use Form Editing for this. Can anyone suggest me a sample code for this.

预先感谢, 阿比舍克

推荐答案

如果需要在网格顶部添加表单编辑按钮,则应使用jqGrid的toppager:true选项.您不需要定义任何其他分页器div,也不需要使用pager选项. jqGrid为寻呼机本身创建一个新的div.寻呼机div的id将根据网格的id和后缀"_toppager"构造.例如,如果您使用

If you need to add form editing buttons on top of the grid you should use toppager:true option of jqGrid. You don't need to define any other pager div and don't need to use pager option. jqGrid creates a new div for the pager itself. The id of the pager div will be constructed from the id of the grid and the "_toppager" suffix. For example if you use

<table id="grid"></table>

然后分页器的div将具有id="grid_toppager",您可以使用

then the div of the pager will have the id="grid_toppager" and you can use

$("#grid").jqGrid("navGrid", "#grid_toppager", {/*navGrid options*/},
    {url: "yourEditUrl"}, {url: "yourAddUrl"}, {url: "yourDelUrl"});

我建议您阅读

I recommend you to read this and this old answers for additional information.

这篇关于JQGrid设置不同的URL以进行添加,编辑,删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆