Accessing Telerik RadGrid edit mode from javascript

假装没事ソ 提交于 2019-12-11 08:21:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!