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

BeforeChange or Selectable=False

3 Answers 196 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 20 Dec 2012, 01:15 PM
I have a master details setup where all of my items are in a listview that uses a template to show a summary of their details.  Once an item is selected, another template is renderend that shows an editable form for the selected item.  I am not using the Edit functionality of the listview.  I would like to prevent the user from selecting a different item if the currently selected item isDirty. 
My question is, would it be best to set Selectable=False when the current item has changes and then to True after changes have been saved/cancelled or is there a better way to handle this scenario?  Would changing the Selectable value even work or is this something that can only be set during initialization? 
Based on similar posts, there seems to be many requests for an event to cancel the Change event of the listView.  I hate to ask, but are there any plans to implement this functionality? 

I am also experiencing an issue where the uid of the selected listview item seems to change when cancelChanges is called on the underlying datasource.  Is this expected behavior?

thanks,

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 Dec 2012, 09:18 AM
Hello Patrick,

 Currently you cannot disable or enable selection programmatically. Selection is enabled only during initialization time. 

 I created a demo showing how to disable selection conditionally: http://jsbin.com/udayuq/1/edit

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Patrick
Top achievements
Rank 1
answered on 24 Dec 2012, 02:23 PM
Thanks.  Your demo works great in FireFox, but does not work in IE9.  Can you make the changes so it work in both browsers?
Are there any plans to enable us to change the Selectable property programmatically?

Thanks again.
0
Atanas Korchev
Telerik team
answered on 26 Dec 2012, 08:10 AM
Hello,

 This example fails in IE9 only in edit mode due to some jsBin quirk. Viewing it without the editing mode works as expected: http://jsbin.com/udayuq/1 The code should work as expected in your project.

We don't have such plans because this is the first time this has been requested. I suggest opening a new feature request in our feedback portal.

Regards,
Atanas Korchev
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
Patrick
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or