jQuery UI Widgets Forums Grid jqxgrid, rows

This topic contains 3 replies, has 2 voices, and was last updated by  lalit singh 10 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • jqxgrid, rows #48836

    lalit singh
    Participant

    Hi,

    I have given cellformat =’n2′, but still the values in cell does not display values in “,” formats like 10,000. for every thousands.

    Below is column i am using in grid. is it fine ?

    {text: ‘Sales’, datafield: ‘fir_sales’, width: 200, cellsformat: ‘n2’},

    regards,

    lalit singh

    jqxgrid, rows #49065

    Dimitar
    Participant

    Hello lalit singh,

    You can add thousands separator support to your column by setting the cellsrenderer callback function as follows:

    {
        text: 'Sales', datafield: 'fir_sales', width: 200, cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
            var num2 = value.toString().split('.');
            var thousands = num2[0].split('').reverse().join('').match(/.{1,3}/g).join(',');
            var decimals = (num2[1]) ? '.' + num2[1] : '';
            var answer = thousands.split('').reverse().join('') + decimals;
            return '<span style="margin: 4px; float: ' + columnproperties.cellsalign + ';">' + answer + '</span>';
        }
    }

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    jqxgrid, rows #49078

    Dimitar
    Participant

    Update: The same effect can be achieved if you set the cellformat to “f2”.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    jqxgrid, rows #49525

    lalit singh
    Participant

    Cellformat to “f2″. its not working. i am providng columntype=”numberinput” then also not working

    but rendering works.

    Thanks,

    lalit singh

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.