EasyUI Forum
May 20, 2024, 04:22:28 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid + formatter + appendRow  (Read 3611 times)
rezzonico
Full Member
***
Posts: 184


View Profile
« on: May 19, 2018, 12:30:09 AM »

Hi all,

I have a datagrid with a combobox field (with valueField and textField).

In the comobox field (vehicle) I use a formatter.
The formatter convert the value received from the server to a string, example:
1 -> car
2 -> airplane

The problem is when I use "appendRow" (but I don't go in edit mode).
$('#dg').datagrid('appendRow', {
   vehicle: 1
}
In this case the formatter is not executed and in the field vehicle i see "1" and not the string "car".

When I use "appendRow" is it possible to add "valueField and textField" of the combobox or to trigger the formatter ?

Thanks
Miche
« Last Edit: May 19, 2018, 06:07:54 AM by rezzonico » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 19, 2018, 09:41:48 PM »

The 'formatter' function does execute when calling 'appendRow' method.
Logged
rezzonico
Full Member
***
Posts: 184


View Profile
« Reply #2 on: May 22, 2018, 02:18:55 AM »

It was my error !

Thanks
Miche
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!