开发者

Accessing rowObejct inside custom formatter

In jqgrid wikki I have read that while using xml datatype rowobject will not be an array. In json I got the column value using rowobject[1],[2],... and so on , but how can I achieve this with xml datatype. Please provide solution to access rowobject inside custom formatter while using xml开发者_JS百科 datatype.

Thanks in advance.


If you use custom formatter together with xml datatype the rowObject parameter will be object represented the DOM element of the corresponding row of the XML input. The type of rowObject is IXMLDOMElement. To find the contain of the corresponding child element which correspond of the column 'myColumn' you can use for example

$(rowObject).find('myColumn').text()

If you use loadonce:true jqGrid parameter, then at the first load the rowObject parameter will be DOM element and at later as the named JavaScript object and the data which you need will be accessed as rowObject.myColumn.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜