Accessing rowObejct inside custom formatter

前端 未结 1 799
清歌不尽
清歌不尽 2021-01-29 04:42

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 ach

相关标签:
1条回答
  • 2021-01-29 05:01

    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 讨论(0)
提交回复
热议问题