问题
I invoke one function in javascript. When I call this function rad grid row is already in edit mode. In that function I get reference to RadGrid:
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
In edit mode I have edit item:
I have a problem here to get/set value of txtName from this javascript function. I have tried:
var item = masterTable.selectItem(masterTable.get_dataItems()[0].get_element());
var item = masterTable.selectItem('txtName');
var item = masterTable.selectItem('txtName').Text;
var item = masterTable.selectItem('txtName').value;
var item = masterTable.selectItem(3)
In all cases item is undefined. Any idea what am I doing wrong here?
回答1:
you could try this bit of jQuery to find it:
var item = $telerik.$(masterTable.get_element()).find('input[id*="txtName"]')[0];
some details on Telerik Jquery: http://www.telerik.com/help/aspnet-ajax/introduction-using-jquery.html
来源:https://stackoverflow.com/questions/9719707/accessing-telerik-radgrid-edit-mode-from-javascript