Custom reordering of columns
Custom reordering of columns
sureshganti
Posts: 5Questions: 0Answers: 0
Hi,
I am using datatables and I need Custom reordering of columns in the client side (Not drag and drop of columns). We have a requirement like we need to show all the columns present in the datatable in a optional multiselect and based on the order of the columns selected I need to change the order. Is it possible in the datatable?
Please let me know.
Thanks,
Suresh.
I am using datatables and I need Custom reordering of columns in the client side (Not drag and drop of columns). We have a requirement like we need to show all the columns present in the datatable in a optional multiselect and based on the order of the columns selected I need to change the order. Is it possible in the datatable?
Please let me know.
Thanks,
Suresh.
This discussion has been closed.
Replies
read http://www.datatables.net/ref#mDataProp
Thanks for the immediate response. I am using mDataProp and Objected based data.
Can you please provide one example how to reorder columns using these.
Thanks,
Suresh
when user changes the multi-select values, create a new aoColumns object by creating an aoColumns object using the master array but with the order customized, then bDestroy the table and re-initialize it with the new aoColumns.
[code]
$(document).ready(function() {
/* Build the DataTable with third column using our custom sort functions */
$('#example').dataTable( {
"aoColumns": [
{ "sTitle": 'NewTitle' } // will over-ride any HTML content in the TH
]
} );
} );
[/code]
Regards,
Suresh.
Thanks for the post. Its working!!!!!!!!
Regards,
Suresh.