Last post Dec 03, 2009 03:35 PM by mattbrooks
Dec 03, 2009 05:27 AM|mattbrooks|LINK
This event fires before the new item in the DataView is selected. The event handler has the option of cancelling the event via the args.set_cancel(true);
Is there any way to determine what the _new_ selected index will be? I could not see any obvious properties on the argument instance passed to the event handler.
ASP.NET Ajax Library
Dec 03, 2009 12:43 PM|InfinitiesLoop|LINK
Note that the command event handles any bubbling command, not just "select". Hence the event's generic nature. But anyway, DataView has a findContext method. You can pass in a DOM element, and it will return the Sys.UI.TemplateContext which was used to create
that DOM element. TemplateContext has a .index field, among lots of other useful things, which will be the selected index. The args to the command event includes what DOM element caused the command.
Dec 03, 2009 03:35 PM|mattbrooks|LINK
Ok, thanks Dave. I didn't manage to make this connection when I was poking around the objects earlier. I will be able to achieve what I was trying to do with what you have suggested.
I've spent a few hours looking around the latest beta - I'm really impressed!