2014-11-22 56 views
0

我有下面的列表,使用自定义分类器:如何使用自定义分类器在XML视图

var oTemplate = ... // irrelevant 

var oList = new sap.m.List({ 
    id: this.createId("someList"), 
    items: { 
     path: "/list", 
     template: oTemplate, 
     sorter: foo.bar.CustomSorter 
    } 
}); 

如何使用XML中的观点自定义分类器? 根据在“Data-binding does not work in XML view”的答案,我试过以下,但没有奏效:

<m:List id="someList" 
     items="{ 
      path: '/list', 
      sorter: 'foo.bar.CustomSorter' 
     }"> 
    <!-- hid ListItem implementation --> 
</m:List> 

各地分拣机卸下报价不也行:

... 
      sorter: foo.bar.CustomSorter 
... 

回答

0

我调试BindingParser看起来像“格式化程序”,“工厂”和“groupHeaderFactory”解析为你想要的参考,但“过滤器”和“分拣机”解析为静态对象。 所以在XML绑定,这是不支持,你应该打开功能要求https://github.com/SAP/openui5/issues

+0

这里是问题:https://github.com/SAP/openui5/issues/233 – 2014-11-24 11:24:45

+0

好吧,我看到它是不可能以这种方式。但如何做到这一点?在控制器上设置分拣机?你可以检查这个问题:http://stackoverflow.com/questions/27104339/how-to-set-sorter-of-a-list-in-controller-in-sapui5 – 2014-11-24 12:00:21

相关问题