EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on May 19, 2018, 12:30:09 AM



Title: datagrid + formatter + appendRow
Post by: rezzonico 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


Title: Re: datagrid + formatter + appendRow
Post by: stworthy on May 19, 2018, 09:41:48 PM
The 'formatter' function does execute when calling 'appendRow' method.


Title: Re: datagrid + formatter + appendRow
Post by: rezzonico on May 22, 2018, 02:18:55 AM
It was my error !

Thanks
Miche