访问自定义格式化程序中的rowObejct [英] Accessing rowObejct inside custom formatter

查看:59
本文介绍了访问自定义格式化程序中的rowObejct的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jqgrid wikki中,我读到使用xml数据类型时rowobject将不是数组. 在json中,我使用rowobject [1],[2],...等获得了列值,但是如何使用xml数据类型来实现这一点. 请提供在使用xml数据类型时访问自定义格式化程序内的rowobject的解决方案.

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 datatype.

谢谢.

推荐答案

如果将自定义格式化程序与xml数据类型一起使用,则rowObject参数将是表示XML输入对应行的DOM元素的对象. rowObject的类型为IXMLDOMElement.要找到与"myColumn"列相对应的相应子元素的包含,您可以使用例如

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()

如果使用loadonce:true jqGrid参数,则在第一次加载时,rowObject参数将是DOM元素,之后是命名的JavaScript对象,所需的数据将以rowObject.myColumn访问.

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.

这篇关于访问自定义格式化程序中的rowObejct的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆