Title: draggable datagrid columns Post by: alex.capurro on February 17, 2012, 06:42:25 AM Hi,
is it possible to drag datagrid columns to change their order? I have not found any examples on the site and the documentation does not mention anything but it surprises me that this is not possible. Title: Re: draggable datagrid columns Post by: stworthy on February 23, 2012, 07:57:05 PM The column moving feature is not added into datagrid plugin, but we can extend some method to do so. Below is the simple implementation of column moving method:
Code: $.extend($.fn.datagrid.methods,{ Now call 'columnMoving' method after the datagrid is created will allow users to move a column to another location. Code: $('#tt').datagrid({ Title: Re: draggable datagrid columns Post by: alex.capurro on February 24, 2012, 01:27:07 AM Hi,
thanks for this. I have pasted your code into my page that has a table (with columns that can be removed/shown by right click menu), however it seems like your code does not actually do anything. When i try to drag a column, nothing happens, my mouse pointer does not even change to suggest that i can drag the columns. Where exactly should I be placing the main part of your code? Would it be possible to see a working demo of your code? Thanks, I really appreciate this. Title: Re: draggable datagrid columns Post by: stworthy on February 24, 2012, 07:34:14 PM The 'movingColumn' method should be extended first. When datagrid is created, call the 'movingColumn' method to make the columns movable. Please download and have a look at the attached file.
Title: Re: draggable datagrid columns Post by: alex.capurro on February 27, 2012, 02:02:06 AM thanks stworthy, it worked brilliantly. I missed out the bottom two lines when i tried to use it so thats why it did not work.
Thank you very much! Title: Re: draggable datagrid columns Post by: rabesh on November 11, 2012, 03:58:32 AM how to disable dnd
Title: Re: draggable datagrid columns Post by: arma on October 06, 2013, 08:16:18 AM If the column sortable is activated and clicking colum header to sort (single click) it will display small popup as it's like start on dragging. How to make the popup shows only when pressing button after 1 or 2 secs, just to make sure it's sorting not to move column.
Any plan to merge your code above for the next release? Title: Re: draggable datagrid columns Post by: hande89 on April 13, 2015, 03:55:54 AM How to do this for treegrid? Same code but just replace word "datagrid" with "treegrid"? :)
|