Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
I want to have format comma igGrid .
posted

I want to have format comma igGrid. This is an image.

Thank you for advice.

Parents
  • 23953
    Offline posted

    Hello Sulada,

    By default format is taken from the regional settings object which in JavaScript can be accessed with:

    $.ig.regional.defaults

    For these settings to take effect for number columns you need to configure igGrid.options.autoFormat option to "dateandnumber". If you're using EN regional settings then the group separator by default is "," which should work for you.

    Here is an example:

    $(".selector").igGrid({
        autoGenerateColumns: false,
        autoFormat: "dateandnumber",
        columns: [
            { headerText: "Product ID", key: "ProductID", dataType: "number", format: "number" },
            { headerText: "SafetyStockLevel", key: "SafetyStockLevel", dataType: "number", width: "200px" }
        ]            
    });
    

    You still have the option to configure the formatting on per column basis by using igGrid.options.columns.format option like this:

    $(".selector").igGrid({
        autoGenerateColumns: false,
        columns: [
            { headerText: "SafetyStockLevel", key: "SafetyStockLevel", dataType: "number", width: "200px", format: "###,###,###.##" }
        ]            
    });
    
    

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc.

Reply Children