EasyUI Forum
March 28, 2024, 02:57:30 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: combobox within edatagrid - value instead text is shown after focusout  (Read 6163 times)
jaimi
Full Member
***
Posts: 119


View Profile
« on: November 18, 2014, 12:44:53 AM »

Hi,
I have a combobox within a edatagrid. It works well to select the text.
But after leaving the row and before saving it changes the visible value to the combobox-value.
Can I avoid this?
Thanks, Jaimi
Logged
phunksta
Jr. Member
**
Posts: 54


View Profile Email
« Reply #1 on: November 20, 2014, 04:22:00 AM »

Hi,

I got stuck with this too a while back. You also need a 'formatter' function for the datagrid column, this should go and pick up the text value that you want to display from the record.
The issue is 'where does that come from' if there is not a column in the data to hold it?

I ended up with 2 approaches to this that both worked: onSelect in the editor for the column you can extend the data row with a new hidden field with the text value for the combo. The 'formatter' function can then pick this up and display it instead.

In the end I was quite lucky as I'm using odata, and the related columns can be obtained by using $extend. This might not mean much to you but in short, as well as the ID column I also retrieved the Text value column from the database. As above when changed I got the combo to change the value in this column.

Have a search about the forum I'm sure you'll find the answer to this.

 Smiley
Logged
jaimi
Full Member
***
Posts: 119


View Profile
« Reply #2 on: November 20, 2014, 09:50:36 PM »

Hi, i ve got. thx, jaimi
« Last Edit: November 20, 2014, 11:54:42 PM by jaimi » 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!