Quantcast
Viewing all articles
Browse latest Browse all 82110

dont sort first row

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.

   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

Viewing all articles
Browse latest Browse all 82110

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>