0

using JQuery-JTable, I'm adding support for drag and drop to reorder.

Got drag and drop working based on this answer jQuery JTable how to drag rows

Now I'm concerned that reorder only makes sense if the table is already sorted by the order column. If its sorted by another column, I'm not really sure what the user wants to do.

Was thinking of making the drag/drop support only enabled when the table is sorted by the order column and when sorted on other columns, disable that aspect.

Is there an event that fires when the sort column changes?

Community
  • 1
  • 1
xeo
  • 807
  • 2
  • 7
  • 25

1 Answers1

1

The source :
if you want disable sort on one collumn :

RecordDate: {
                title: 'Record date',
                width: '15%',
                type: 'date',
                displayFormat: 'yy-mm-dd',
                create: false,
                edit: false,
                sorting: false  // here , you can specify that it's not sortable
            }

if you want disable it on the entire table :

 //Prepare jtable plugin
    $('#StudentTableContainer').jtable({
        title: 'Student List',
        paging: true,
        sorting: true, // set it to false
        defaultSorting: 'Name ASC',
        selecting: true, //Enable selecting
        multiselect: true, //Allow multiple selecting
        selectingCheckboxes: true, //Show checkboxes on first column
        //selectOnRowClick: false, //Enable this to only select using checkboxes
Azrael_404
  • 426
  • 1
  • 6
  • 17
  • this is correct for setting the initial sort up. i was referring to when the user clicks on the sort headers. can i tell that the sort column has changed so i can dis/enable the drag and drop feature? – xeo Mar 03 '14 at 14:28
  • take a look to this post :http://stackoverflow.com/questions/1155137/how-to-keep-a-single-column-from-being-reordered-in-a-jtable/1155277#1155277 – Azrael_404 Mar 03 '14 at 14:43
  • looks like that is the right direction to go. ick. – xeo Mar 03 '14 at 14:46