DataTables - Total rowCount - How to cut euro sign in the columns?

Posted by Ivan M on Stack Overflow See other posts from Stack Overflow or by Ivan M
Published on 2012-12-03T10:58:21Z Indexed on 2012/12/03 11:08 UTC
Read the original article Hit count: 181

Filed under:
|

For my DataTable I'm using the fnFooterCallback function to display the total amount of the column, which is working untill the columns contain a special character, like in this case a euro valuta sign.

How can I adjust this code so it will not detect the euro sign?

        "fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
        /*
         * Calculate the total market share for all browsers in this table (ie inc. outside
         * the pagination)
         */
        var iTotal = 0;
        for ( var i=0 ; i<aaData.length ; i++ )
        {
            iTotal += aaData[i][7]*1;
        }

        /* Calculate the market share for browsers on this page */
        var iPage = 0;
        for ( var i=iStart ; i<iEnd ; i++ )
        {
            iPage += aaData[ aiDisplay[i] ][7]*1;
        }

        /* Modify the footer row to match what we want */
        var nCells = nRow.getElementsByTagName('th');
        nCells[1].innerHTML = parseInt(iPage);
        }

Thank you in advance.

EDIT With not detecting I mean to str_replace or something like that. Not familiar with javascript language..

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about datatable