EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jaimi on November 18, 2014, 12:44:53 AM



Title: combobox within edatagrid - value instead text is shown after focusout
Post by: jaimi 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


Title: Re: combobox within edatagrid - value instead text is shown after focusout
Post by: phunksta 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.

 :)


Title: Re: combobox within edatagrid - value instead text is shown after focusout
Post by: jaimi on November 20, 2014, 09:50:36 PM
Hi, i ve got. thx, jaimi