EasyUI Forum
May 16, 2024, 05:08:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Problem edit currency on datagrid  (Read 7894 times)
noerone
Newbie
*
Posts: 13


View Profile
« on: October 29, 2013, 07:40:46 PM »

I am using a DataGrid to call a column from a database with the results that I have modified. suppose the original data is 12000 and after my modifications to 12,000.00 (without changing the data in the database).

But if I want to edit the data in the DataGrid with the "editing in the DataGrid" why when clicked 2x the value changed to 12 and not 12000. Is there a way so that when I click 2x then the value is automatically changed to 12000?

please help me
thank you
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 30, 2013, 12:44:04 AM »

Don't change the value to '12,000.00'. It will be acted as '12' when parsing as decimal value. Please use 'formatter' function to format the original value(12000) to '12,000.00'.
Logged
yupengfei
Newbie
*
Posts: 10


View Profile
« Reply #2 on: November 15, 2013, 03:23:15 AM »

Code:
 columns:[[   
          {field:'price',title:'Price',width:100, formatter:function(value,rowData,rowIndex){
return value + "";
 }}
      ]]  
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!