Is there a way to fire the ItemCommand event from javascript the same as it would coming from a telerik control within a template item? Using a telerik checkbox or other control inside a template, I can set the command name and argument. When the server side itemcommand event fires, the event args parameter will have the command name, command argument, as well as the correct data item.
I have an ASP checkbox that calls a javascript function to do some validation. I then call the mastertable.fireCommand function, which triggers the server side itemcommand event. I'm able to pass the command and argument, but the data item in the event args is always index zero. I've found a way to retrieve the index of the data item on the client, and pass that index as the commandargument. But I'd like to be able to use the commandargument parameter for something else.
function CheckClick(sender, Idx) {
debugger;
var masterTable = $find("<%= rgGrid.ClientID %>").get_masterTableView();
var row = masterTable.get_dataItems()[Idx];
masterTable.fireCommand("Post", Idx);
}
I could combine the index and additional data and send it together in the command argument, so I do have a workaround. But since the telerik controls are able to pass all three, I assume there should be a better way. I expected something like a fireCommand function of the data item, but I'm not finding anything. How do the telerik controls do that?