jQuery:在jqGrid中可以重新排序工具栏按钮 [英] jQuery: In jqGrid is it possible to reorder the toolbar buttons

查看:123
本文介绍了jQuery:在jqGrid中可以重新排序工具栏按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jqGrid中是否可以对页脚工具栏中的默认按钮重新排序?我试图让搜索"按钮显示在删除"按钮之前.我已经阅读了文档,找不到任何提及,但认为可能有一个简单的窍门.

In jqGrid is it possible to reorder the default buttons in the footer toolbar? I'm trying to get the Search button to display before the Delete button. I've read the documentation and couldn't find any mention of it but thought there might be a simple trick.

推荐答案

没有标准选项可以重新排序

There are no standard options which allows to reorder the buttons in the navigator toolbar. On the other side no part of jqGrid code is depend on the order, so you can reorder the buttons yourself.

要执行此操作,您应该知道按钮的ID是根据前缀"add _","edit _","del _","search _","refresh _","view_"和网格的ID构建的.如果网格的ID为列表",则代码可能为

To do this you should know that the ids of the buttons are build from the prefix "add_", "edit_", "del_", "search_", "refresh_", "view_" and the id of the grid. If the id of the grid is "list" then the code could be

$("#list").jqGrid("navGrid", "#pager");
$("#search_list").insertBefore("#del_list");

并将搜索按钮从其标准位置移出

and it move the search button from it's standard place

在更常见的情况下,如果您有代表$("#list")的变量$grid,则代码为

In more common case, if you have variable $grid which represent $("#list"), the code will be

$grid.jqGrid('navGrid', '#pager');
var gridid = $.jgrid.jqID($grid[0].id);
$("#search_" + gridid).insertBefore("#del_" + gridid);

仅当网格的ID可能包含特殊的元字符(例如!"#$%&'()*+,./:;<=>?@[\]^``{|}~)时才需要功能$.jgrid.jqID,如果在选择器中使用了特殊的元字符,则必须将其转义(请参见

The function $.jgrid.jqID are needed only if the id of the grid could contain special meta-characters like !"#$%&'()*+,./:;<=>?@[\]^``{|}~ which must be escaped if there are used in the selectors (see here for more information).

您将在此处找到相应的演示.

The corresponding demo you will find here.

这篇关于jQuery:在jqGrid中可以重新排序工具栏按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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