EasyUI Forum

General Category => General Discussion => Topic started by: markalves on November 28, 2017, 08:31:37 AM



Title: Combobox in edatagrid show id instead of description
Post by: markalves on November 28, 2017, 08:31:37 AM
Hi to all,
I have an edatagrid with a combobox I would like to show the description instead of index when I show the datagrid:

i.e.=
Table products is this:
id =1   description:'apple'

When I edit all ok combobox is displayed correctly but after confirmation the datagrid show
the id (1): How I can show 'apple' instead ?
this is the row code:
<th field="id" width="30" editor="{type:'combobox', options:{mode:'remote',valueField:'id',textField:'description',url:'combofruit.php',required:true}}">Frutta</th>


Title: Re: Combobox in edatagrid show id instead of description
Post by: stworthy on November 29, 2017, 05:06:15 PM
You should define a 'formatter' function to display the description for the datagrid. When end the editing, retrieve the description from the combobox and update to the editing row. For more information please look at this example https://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=material&dir=ltr&pitem=Row%20Editing%20in%20DataGrid&sort=