Skip to content

Resetting counter column #47

@samdamnu

Description

@samdamnu

I need to have the first column of my tables as a counter column (row numbers) that does not get affected by sorting (like in this datatables API example). But inserting that code snippet in the into the fnDrawCallback function breaks the responsive behavior. The columns are hidden alright, but are not expandable anymore.

        fnDrawCallback : function (oSettings) {
            responsiveHelper.respond();


            /* Need to redo the counters if filtered or sorted */
            if ( oSettings.bSorted || oSettings.bFiltered )
            {
                for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
                {
                    $('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
                }
            }

        }   

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions