How to enable column reordering in SlickGird via drag/drop?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 07:45:53

问题


I've seen it done in the samples, but can't get it to work on my Grid.

What do I need to do in order to allow drag/drop column reordering in SlickGrid?

Thanks.


回答1:


To create the grid, you should be doing something like:

grid = new Slick.Grid($("#myGrid"), data, columns, options);

options is a dictionary that you can use to change the behavior of the slickgrid. Make sure that the enableColumnReorder key is set to true:

var options = {
  enableColumnReorder: true
};

If this does not work, please do post your code so we can take a look.




回答2:


Answering the comments above (@hiphip) - slickgrid comes with a bundled compatible version of jquery-ui. You need to add this as a script tag to you page e.g.

<script src="/slickgrid/lib/jquery-ui-1.8.16.custom.min.js"></script>


来源:https://stackoverflow.com/questions/6540642/how-to-enable-column-reordering-in-slickgird-via-drag-drop

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!