Filter function for wsapi store not working in Rally SDK

spsteffl

EDIT- ANSWER FOUND

I realize why its not working. The 'filters' config field i was reading about was based on the Ext.data.AbstractStore class's config, not Rally's Rally.data.wsapi.Store config. Rally doesn't support the filter 'functions' becasue all Rally.data.wsapi.Store filters get turned into the wsapi query syntax (I read that in the SDK guide), which you cannot do with functions. That is why they only accept the Object[] argument, not Function[] argument.

So please correct me if I'm wrong, but i believe that the documentation for the wsapi Stores are wrong for the 'filters' config field.


I am trying to use a customized filter function to load Features from a list of User Stories. My issue is with understanding how filter functions work for the store Configuration. Right now i have:

_loadFeatures: function(cb){ 
    var me = this;
    Ext.create('Rally.data.wsapi.Store',{
        model: 'PortfolioItem/Feature',
        autoLoad:true,
        start: 0,
        pageSize: 20,
        fetch: //stuff
        context: //stuff
        filters:[
            function(feature){ return false; },
            function(feature){
                return feature.get('Release').Name == me.releaseRecord.get('Name');
            },
            function(feature){
                var oid = feature.get('ObjectID');
                var rs = me.StoryStore.getRecords();
                for(var i = 0;i<rs.length;++i){
                    var r = rs[i];
                    if(r.get('Feature') && r.get('Feature').ObjectID == oid) 
                        return true;
                }
                return false;
            }
        ],
        listeners: //stuff
    });
},

There are a few things that are confusing me:

1) One of my functions returning false no matter what, which I believe should return NO results. Yet the store returns all of the Features, like there were no filters at all (it returns the first page of results, but the pages include all features)

2) can we tread the parameters in the filter functions as 'records' or the records' data, similar to record.data. What i mean is should I be using record.get('ObjectID') or record.ObjectID.

3) can I even use the 3rd filter function above, because it requires scoped variables, and the filtering is done server side. Are the scope variables preserved?.

I don't know the answers to these because i can't put console logs in the filter functions, as they are filtered server side.

Kyle Morse

You can still further filter the store on the client side after it has been loaded and remote filtered on the server:

http://help.rallydev.com/apps/2.0rc3/doc/#!/api/Ext.data.Store-method-filterBy

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Wsapi data store filter issues

From Dev

Rally App SDK 2.0 - filter by date

From Dev

how to set allowed values through Rally WSAPI?

From Dev

how to set allowed values through Rally WSAPI?

From Dev

Rally LookBack API with Release filter not working

From Dev

Rally Query in the SDK 1 vs Store in the SDK 2

From Dev

Retrieve all fields from Rally WSAPI Recycle bin

From Dev

Can I masquerade as another user when creating/updating Rally artifact using Rally WSAPI?

From Dev

Store function not working in Laravel

From Dev

How the Filter function is working?

From Dev

Rally SDK 2 custom sorters

From Dev

Rally Custom HTML - Filter on Milestones

From Dev

Rally Custom HTML - Filter on Milestones

From Dev

Working of stats::filter function R

From Dev

Filter function not working in a Todo App

From Dev

Swift 3.0 filter function not working

From Dev

Search and Filter Function in PHP not working

From Dev

Rally Pie chart listener not working

From Dev

filters not working on specific workspace rally

From Dev

Upgrading my Rally app from rally SDK 1.32 to rally SDK 2.0p5

From Dev

Rally SDK external development Rally.environment undefined

From Dev

facebbok js sdk login function not working

From Dev

Restricting a Rally chart snapshot store to a date period

From Dev

Updating iteration for story using Rally SDK

From Dev

Building Rally Apps Intro to 2.0 SDK

From Dev

In Rally SDK, show hidden fields in UI components

From Dev

Does SDK 2.0 work outside of Rally?

From Dev

Rally SDK 2.0 displaying debug information

From Dev

Rally filter dropdown for custom field for matrix