I'm trying to expand and collapse my nested views all on the client since it typically takes 4-5 seconds just to collapse a row on the server side, and it doesn't even have to retrieve data! So I added a javascript function to the OnRowClick client event:
I used the get_selected because I wasn't getting anything from the get_expanded. But get_selected works, and set_selected works. In either case, set_expanded does NOT work and I can't figure out why. It's driving me NUTS. I also tried setting the state from the masterViewTable using expandItem and collapseItem, but those don't work and I suspect it has something to do with the HierarchyLoadMode not being set to Client.
Another bit of info: I'm setting the data in the nested view on the server side in the OnItemCommand method. I check to see if the command name is "RowClick" or "ExpandCollapse" and get the data based on that. I was expanding or collapsing the rows there too, but I found that even when I didn't have to retrieve the data and all I had to do was collapse the row, it still took 4-5 seconds. That's just not acceptable, so I'm hoping this solution will go much quicker...?
Is there SOME example of how this works somewhere? I have to get this project done by Friday and I can't get Telerik to respond to my support tickets. I could really use some help...
Thanks, eddie
function rgWtsRowClick(sender, args) { |
var idx = args.get_itemIndexHierarchical(); |
var currentItem = sender.get_masterTableView().get_dataItems()[idx]; |
if(currentItem.get_selected()) { |
currentItem.set_selected(false); |
currentItem.set_expanded(false); |
} else { |
currentItem.set_selected(true); |
currentItem.set_expanded(true); |
} |
} |
Another bit of info: I'm setting the data in the nested view on the server side in the OnItemCommand method. I check to see if the command name is "RowClick" or "ExpandCollapse" and get the data based on that. I was expanding or collapsing the rows there too, but I found that even when I didn't have to retrieve the data and all I had to do was collapse the row, it still took 4-5 seconds. That's just not acceptable, so I'm hoping this solution will go much quicker...?
Is there SOME example of how this works somewhere? I have to get this project done by Friday and I can't get Telerik to respond to my support tickets. I could really use some help...
Thanks, eddie