RowReorder
RowReorder
Please help me how i can add RowReorder in the following code
var grid = new Datatable();
grid.init({
src: $("#datatable_site"),
onSuccess: function(grid) {
// execute some code after table records loaded
},
onError: function(grid) {
// execute some code on network or other general error
},
dataTable: {
"aLengthMenu": [
[20, 50, 100, 150, 200],
[20, 50, 100, 150, 200] // change per page values here
],
"iDisplayLength": 20, // default record count per page
"bServerSide": true, // server side processing
"sAjaxSource": BASE_URL +"/admin/successStoryList", // ajax source
"aaSorting": [[1, "asc"]
], // set first column as a default sort by asc
"fnServerParams": function(aoData) {
aoData.push({
"name": "sAction",
"value": 'filter'
});
aoData.push({
"name": "_token",
"value": $('#_token').val()
});
aoData.push({
"name": "mem_username",
"value": $('#mem_username').val()
});
aoData.push({
"name": "status",
"value": $('#status').val()
});
aoData.push({
name: "sGroupActionName",
value: sGroupActionName
});
aoData.push({
name: "id[]",
value: id
});
aoData.push({
name: "key",
value: $('#_key').val()
});
aoData.push({
name: "val",
value: $('#_val').val()
});
},
"aoColumns": [
{
"bSearchable": false,
"bSortable": false
},
{
"bSearchable": false,
"bSortable": false
},
{
"bSearchable": false,
"bSortable": false
},
{
"bSearchable": false,
"bSortable": true
},
{
"bSearchable": false,
"bSortable": true
},
{
"bSearchable": false,
"bSortable": true
},
{
"bSearchable": false,
"bSortable": true
},
{
"bSearchable": false,
"bSortable": true
},
{
"bSearchable": false,
"bSortable": true
},
{
"bSearchable": false,
"bSortable": true
},
]
}
});
Answers
https://datatables.net/reference/option/rowReorder
read the docs please... this is not a free coding service
i read this but it did not work for me, please tell me where i should add
rowReorder: true in the above code?
Looks like you are using an old version of Data Tables. Your syntax is older for sure. You would need to check whether row reorder works for that version.
If it does I would insert rowReorder: true here:
If you can give us a link to a test case showing the issue, as required in the forum rules, I’ll take a look and debug what it isn’t working for you.
Allan