如何通过拖动列标题重新排序jqgrid中的列 [英] how to reorder columns in jqgrid by dragging column headers

查看:513
本文介绍了如何通过拖动列标题重新排序jqgrid中的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处中的jqgrid文档包含:

jqgrid doc in here contains:

方法允许使用鼠标重新排列网格列.在这种情况下,唯一必要的设置是将jqGrid中的sortable选项设置为true.

method allow to reorder the grid columns using the mouse. The only necessary setting in this case is to set the sortable option in jqGrid to true.

我有sortable:true,但是无法通过用鼠标拖动标题来对列进行重新排序.如何在不使用列选择器的情况下通过拖动列标题或其他方式对列进行重新排序?

I have sortable: true but columns cannot reordered by dragging headers by mouse. How to re-order columns by dragging columns headers or other way without using column chooser ?

推荐答案

实现可排序的列确实很容易.您只需遵循文档.你应该

To implement sortable columns is really easy. You should just follow the documentation. You should just

    总是需要
  1. 除了jquery-ui.css之外还包括jquery-ui.min.js.大多数人已经因为使用jQuery UI小部件(如Datepicker,自动完成,标签等)而包含了该文件.
  2. 在网格中添加sortable: true选项.
  1. include jquery-ui.min.js additionally to jquery-ui.css which are always required. The most people have the file already included because of usage jQuery UI Widgets like Datepicker, Autocomplete, Tabs and so on.
  2. add sortable: true option to the grid.

现在您可以(请参见演示)将列标题拖放到另一个位置.

Now you can already (see the demo) drag the column header and drop it on another position.

这篇关于如何通过拖动列标题重新排序jqgrid中的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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