jQuery UI Widgets Forums Grid How to show Rs(for India) in jqxgrid currently showing $(dollar)

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 9 years, 2 months ago.

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

  • kadursandy
    Participant

    How to show Rs(for India) in jqxgrid, currently showing $(dollar) on a specific column like Exchange rate. Please help me with example.

    Code:
    { text: ‘Exch Rate’, datafield: ‘exch_rate’, width: 80, cellsalign: ‘right’, cellsformat: ‘c2’, columntype: ‘numberinput’,
    validation: function (cell, value) {
    if (value < 0 || value > 100) {
    return { result: false, message: “Price should be in the 0-100 interval” };
    }
    return true;
    },
    createeditor: function (row, cellvalue, editor) {
    editor.jqxNumberInput({ digits: 3 });
    }
    },


    Dimitar
    Participant

    Hello kadursandy,

    This can be done by localizing the grid (specifically by setting the property currencysymbol to ‘Rs’).

    Best Regards,
    Dimitar

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


    kadursandy
    Participant

    Thanks!. I am sorry my question was not very specific.

    I need to apply localization on specific columns not whole grid. I am using cellsformat: ‘c2’, columntype: ‘numberinput’ , always $ is displayed.
    Few columns in need $ , Rs and NO symbol to be displayed Eg: for Exchange Rate(number input is required with 2 decimal places input).

    I have editable columns in the grid which has both currencies. Eg: Column Unit Price $10.00(in dollars) and need to converted to India Rs Eg: Column Unit Price in INR(Rs600.00) and Duty Percentage(Eg: 10%). I use numberinput also with cellsformat(c2)

    Currently displays $ symbol, I don’t require any dollar symbol. But I need the numberinput 00.00 for in-putting with 2 decimal places.
    { text: ‘Exch Rate’, datafield: ‘exch_rate’, width: 80, cellsalign: ‘right’, cellsformat: ‘c2’, columntype: ‘numberinput’,
    validation: function (cell, value) {
    if (value < 0 || value > 100) {
    return { result: false, message: “Exch rate should be 0-100” };
    }
    return true;
    },
    createeditor: function (row, cellvalue, editor) {
    editor.jqxNumberInput({ digits: 3 });
    }
    },

    Require: Rs in the display
    { text: ‘INR Value’, datafield: ‘inr_val’, width: 80, cellsalign: ‘right’, cellsformat: ‘c2’, columntype: ‘number’,
    cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
    var total = 1000; //(some calculation is done)
    return “<div style=’margin: 4px;’ class=’jqx-right-align’>” + dataAdapter.formatNumber(total, “c2”) + “</div>”;

    }
    },

    % symbol to be displayed for at the end of input for Duty Percentage.
    { text: ‘Duty Perct’, datafield: ‘duty_perct’, width: 80, cellsalign: ‘right’, cellsformat: ‘c4’, columntype: ‘numberinput’,
    validation: function (cell, value) {
    if (value < 0 || value > 100) {
    return { result: false, message: “Price should be in the 0-100 interval” };
    }
    return true;
    },
    createeditor: function (row, cellvalue, editor) {
    editor.jqxNumberInput({ digits: 6 });
    }
    },


    Dimitar
    Participant

    Hi kadursandy,

    Then we suggest the following (no localization necessary):

    {
        text: 'INR Value',
        datafield: 'inr_val',
        width: 80,
        cellsalign: 'right',
        // cellsformat: 'c2',
        columntype: 'number',
        cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
            var total = 1000; //(some calculation is done)
            return "<div style='margin: 4px;' class='jqx-right-align'>" + total.toFixed(2) + " Rs</div>";
    
        }
    },

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.