rally - Using a function for WsapiDataStore's filters config option -
using sdk 2.0.
i need help figuring out way utilize function in wsapidatastore's 'filters:' config option. when run below code, errors. if remove 'filters:' option, no error.
i need utilize function since have check 1 status or another.
anyone have thought how working?
thanks!
ext.define('customapp', { extend: 'rally.app.app', componentcls: 'app', launch: function() { var features = ext.create('rally.data.wsapidatastore', { model: 'portfolioitem/feature', autoload: true, remotesort: false, filters: [ function (item) { homecoming true; } ], listeners: { load: function(store, data, success) { console.log('store loaded in launch:', store); }, scope: } }); } });
here's error.
uncaught typeerror: cannot phone call method 'tostring' of undefined sdk.js:4 a.define._createquerystring sdk.js:4 a.define.tostring sdk.js:4 a.define.encodefilters sdk.js:4 a.define.encodefilters sdk.js:4 ext.define.getparams sdk.js:4 ext.define.buildrequest sdk.js:4 b.implement.callparent sdk.js:4 a.define.buildrequest sdk.js:4 ext.define.dorequest sdk.js:4 ext.define.read sdk.js:4 ext.define.load sdk.js:4 b.implement.callparent sdk.js:4 ext.define.load sdk.js:4 b.implement.callparent sdk.js:4 a.define.load sdk.js:4 b.implement.callparent sdk.js:4 a.define.load sdk.js:4 a.define.load.rally.data.modelfactory.getmodel.success sdk.js:4 b sdk.js:4 (anonymous function) sdk.js:4 d sdk.js:4 a.define._ontypedefinitionsretrieved sdk.js:4 a.define._fetchtypedefinitions.rally.environment.getioprovider.httpget.success sdk.js:4 ext.apply.callback sdk.js:4 e sdk.js:4 ext.apply.callback sdk.js:4 ext.define.oncomplete sdk.js:4 ext.define.onstatechange sdk.js:4 (anonymous function) sdk.js:4
check out:
rally.data.queryfilter
along stackoverflow answer:
rally app sdk 2.0: cannot modify queryfilter object after initial creation
which shows nice illustration of using rally.data.queryfilter prepare array of filters representing multiple conditions. wrap logic in function , accomplish desired end result.
rally
No comments:
Post a Comment