Sort column with numbered input fields built using Bootstrap

Sort column with numbered input fields built using Bootstrap

upstatewebupstateweb Posts: 4Questions: 2Answers: 0

I can't quite figure out how to write the code to allow an input column of display order numbers in input fields. You can see what I am talking about here, http://www.profusioncms.com/anchors.htm. Here is the code I have written:

/* Create an array with the values of all the input boxes in a column, parsed as numbers */ $.fn.dataTable.ext.order['dom-text-numeric'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { return $('input', td).val() * 1; } ); } $(document).ready( function () { var table = $('#recordsTable').dataTable( { columnDefs: [ { targets: [0,3], orderable: false, } ], order: [[ 1, 'desc' ]], orderDataType: 'dom-text-numeric', }); var tt = new $.fn.dataTable.TableTools( table , { sSwfPath: '/profusion/bootstrap/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf', aButtons: [ 'xls', 'pdf' ], } ); $( tt.fnContainer() ).insertAfter('div.buttons'); } );

Thank you for your help in advance.

David G. Moore, Jr.
UpstateWeb LLC

This discussion has been closed.