EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jahangir on November 19, 2020, 06:53:43 AM



Title: Thousand separator in datagrid column in cell editng mode
Post by: jahangir on November 19, 2020, 06:53:43 AM
How to use thousand separator in datagrid column in cell editng mode.

I use this code it shows thousand separator after loading data and on begain edit but after edit thousand separator disappears from edited cell.

Code:
<th data-options="field:'listprice',width:80,align:'right',editor:{type:'numberbox',options:{precision:0, groupSeparator:','}},
      formatter:function(value, row){
            var number = row.listprice;                                   
            return number.toLocaleString('en-US', {minimumFractionDigits: 0});
                                    }
 ">List Price</th> 


Please check following example code.

http://code.reloado.com/jbhatti/34/edit#html,live


Title: Re: Thousand separator in datagrid column in cell editng mode
Post by: jarry on November 19, 2020, 11:31:54 PM
Please call 'parseInt' function to convert field value to an integer.
Code:
formatter:function(value, row){
    var number = parseInt(row.listprice);                                   
    return number.toLocaleString('en-US', {minimumFractionDigits: 0});
}

This is the updated example.

http://code.reloado.com/jbhatti/35/edit#source


Title: [SOLVED] Thousand separator in datagrid column in cell editng mode
Post by: jahangir on November 20, 2020, 01:47:55 AM
Thank's Jarry
Its working now as expected.