This is a migrated thread and some comments may be shown as answers.

ComboBox in ListView Inline Edit

1 Answer 224 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
Joshua asked on 06 Sep 2012, 09:21 PM
I am having several problems that I just cannot figure out. I would like to use a combobox or an autocomplete as part of my edit template. I cannot use a static list and i need to search because i could have thousands of results. 

I have been trying to get these routine tasks to work for several days now and I am having no luck.This has to be a scenario that lots of people use. There is a simple lookup where i need to get the resultant id and attach it to a record and i dont care about the text, just the id.  
If there were more complete examples out there I would assume I can figure this out, but there isn't and I cannot. Please help.

I have included a fiddle that displays all of the problems that I am seeing when I try to edit a ListView inline. http://jsfiddle.net/grippstick/Zv7mc/

  1. When you edit an item it updates the data-value-field with the data-text-value. In the jsFiddle you will see the SkillID is overwritten with the Skill Name.
  2. When you edit and then click the drop down, it selects the first item in the list and not actual value that is already present.
  3. If you click edit on one row and then click edit on another row, the list view will go out of edit mode, but then the buttons will not work and it never goes back into edit mode.
  4. The save event still fires even if the required field is not filled out and it does not pass validation. It does not move my data back to my original object, so i have to copy it. i would assume i do it here.
  5. How would this work with an autocomplete? I can only seem to get the text field to show and it always displays the id by default.

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 10 Sep 2012, 01:27 PM
Hello Joshua,

Hello Joshua,

First you will have to define model for the ListView DataSource, as this is required for editing.

Next in order to update both fields SkillID and SkillName you will have to handle change of the ComboBox widget and manually update the model fields.

For more details please refer to the updated jsfiddle: http://jsfiddle.net/F4NvL/

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView
Asked by
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Nikolay Rusev
Telerik team
Share this question
or