【发布时间】:2014-03-12 23:47:04
【问题描述】:
我从网络服务加载一些数据并尝试过滤它。
var topLevelProductTypes = [];
topLevelProductTypes = productTypesArray.filter(function (pt) {
return (pt.NS_designcentreproducttypeid.Id === null);
});
我收到错误 SCRIPT438:对象不支持属性或方法“过滤器”
【问题讨论】:
-
您是否处于兼容模式?
productTypesArray真的是一个数组吗? -
此代码在 CRM 2011 内的 Web 资源上运行。我使用 crm 的 xrm 端点将 json 数据推送到 productTypesArray。
-
>> productTypesArray[0] { [prototype] : {...}, __metadata : {...}, NS_designcentreproducttypeid : {...}, NS_designcentretypeId : "558b2086-478e-e111- 8108-0050568d0006", NS_name : "1 Piece Enclosure (Shower)" } 添加到观看 >> productTypesArray[0].NS_designcentreproducttypeid.Id "15af4efc-468e-e111-8108-0050568d0006" >> productTypesArray[0].NS_designcentreproducttypeid { [原型]:{...},__metadata:{...},ID:“15af4efc-468e-e111-8108-0050568d0006”,逻辑名称:“ns_designcentretype”,名称:“阵雨”} 添加到观看
标签: javascript arrays html filter dynamics-crm-2011