问题
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