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

Unexpected behavior with MultiSelect Grid

3 Answers 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 21 Feb 2017, 08:22 PM

Hi,

 

I am trying to install a multi select editor in my grid. I am following this tutorial: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Editing/use-multiselect-as-custom-editor

 

I changed the implementation so that the widget takes and gives a string of values separated by a comma, rather than an array of strings. This is because the data of the column needing the multi-select editor comes in the form of a comma-separated list of 'Codes' that I then have to map to a human-friendly string representation to use in the muliselect widget

 

Now I have a bug where, if I type something into the input box, ie: "Rea", and leave the cell without selecting a value, and then try to edit another row, the editor won't clear out my previous input. The input field is blank, but behaves as if the previous "Rea" is still present.

How do i clear out the editor's value each time?

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 23 Feb 2017, 03:45 PM

Hello Jeff,

I am afraid that in this case I would need an example which replicates this behavior. Could you please try to modify the tutorial in the dojo, change the DataSource of the MultiSelect according to your requirement and replicate the issue? This way we can review your logic and suggest a proper solution. 

Regards,
Boyan Dimitrov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jeff
Top achievements
Rank 1
answered on 02 Mar 2017, 10:30 PM

Boyon,

Here is an example that shows the problem.

http://dojo.telerik.com/OPExO/2

If you type 'A' as a value for either row 1 or 3, and blur the multi-select dropdown without selecting a value, when you try to edit the value of another row, the widget does not clear out the 'A'. Every other example i've seen, you can type something into the widget, and it goes away of you blur the widget, or try to edit another row.

The only difference between that example and my original problem is that the data source I am using for the multi select widget is fetching data from a remote source. In my app, I load that data before I load the grid's data, then initialize the grid.

I got the editor to show and behave without error by calling the data() method of the datasource and using that value for the multiselect. (I do not get the same response in the example I'm  posting).

 There are lots of examples out there showing a MultiSelect stand-alone widget with an array of name-value pairs as datasources, and there are lots of examples showing a MultiSelect Widget inside a grid using an array of strings as the datasources. But I couldn't find anywhere that showed a MultiSelect widget inside a grid using an array of objects as the data source.

This example shows a MultiSelect widget inside a grid using an array of objects as the data source.

0
Boyan Dimitrov
Telerik team
answered on 06 Mar 2017, 11:53 AM

Hello Jeff,

Unfortunately I am not able to replicate the described issue when I test the http://dojo.telerik.com/OPExO/2 example. I made a video that shows the behavior of the application when I try to edit the Value field either on first or third row, but without selecting anything from the drop down. It does not change the underlying model at my side or I am missing something. 

Please take a look at the https://www.screencast.com/t/wEuje6Vqh screen cast. 

Regards,
Boyan Dimitrov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Jeff
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or