Hi, i have a datatable where the first row is the insert-row (css-class=InsertRow)
I want to ignore that row when sorting the table so that the insert-row is always the first row.
edit:
following code seems to work despite the fact, that the first row moves either way...
when i debug the code the array gets constructed just like i want it to (insertrow is first entry) but the row is shown somewhere else either way.
What am i doing wrong here?
Best regards,
r3try
I want to ignore that row when sorting the table so that the insert-row is always the first row.
edit:
following code seems to work despite the fact, that the first row moves either way...
when i debug the code the array gets constructed just like i want it to (insertrow is first entry) but the row is shown somewhere else either way.
jQuery.fn.dataTableExt.afnSortData['dom-text'] = function (oSettings, iColumn) { var aData = []; jQuery('td:eq(' + iColumn + ') input[type=text]:first', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () { var col = jQuery(this).closest('tr'); if (col.hasClass('InsertRow')) { aData.unshift("-1");//insert at front } else { aData.push(this.value);//append to back } }); return aData; }
What am i doing wrong here?
Best regards,
r3try