EasyUI Forum
March 29, 2024, 03:04:45 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: Combobox in edatagrid show id instead of description  (Read 4699 times)
markalves
Newbie
*
Posts: 15


View Profile
« 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>
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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=
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!