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?

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top