开发者

Drag & drop columns into or out of the SlickGrid

开发者 https://www.devze.com 2023-04-12 04:21 出处:网络
I am just learning about the impressive SlickGrid library; and here\'s my question: We would like to give users the ability to drag & drop columns from开发者_高级运维 a list of possible columns i

I am just learning about the impressive SlickGrid library; and here's my question:

We would like to give users the ability to drag & drop columns from开发者_高级运维 a list of possible columns into the grid to add columns (and possibly likewise drag & drop columns out of the grid to remove columns). Think: Outlook field chooser - where you can add/remove the To column, the From column, etc. via drag & drop.

Any chance that this might be possible? Many thanks, Dave


It isn't drag and drop, but there is a context menu in the header that allows you to check off the columns you want to show/hide. You can customize it in the slick.columnpicker.js file.


This isn't currently possible since you'd essentially have to modify SlickGrid's built-in column management code. As part of an on-going componentization of SlickGrid, that code may get moved into a separate plugin, which would make it easier to extend. In the meantime, you can extend the column picker control (included in the distro) to have two lists with columns that can be drag'n'dropped within the control itself (not onto the grid's columns).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号