Reference Filter

2
I am writing this in regards to the proper JS notation when trying to pull specific reference data via the client API. Per the documentation: args.filter.references Object Key-value pairs of reference name and options. But there are no examples of how this object should be formed. Here is an example of the call I am trying to make: mx.data.get({ xpath : "//Administration.Account", filter : { attributes : ["FullName"] ,references : { /* I want to get a reference, "Administration.Account_Seller" */} } }); Does anyone know of the proper way to form the references Object? On a side note, if I use distinct, will it distinct only on the attribute, or on both the attribute and the reference(s)?
asked
2 answers
1

See GridSelector widget:

var schema = {
    attributes: [this.leftDisplayAttr],
    sort: [
        [this.leftSortAttr, this.leftSortOrder]
    ],
    offset: page * this.pageLimit,
    limit: this.pageLimit,
    references: {}
};

schema.references[this.assoc[0]] = {
    attributes: [this.topDisplayAttr],
    sort: [
        [this.topSortAttr, this.topSortOrder]
    ]
};

    mx.data.get({
        xpath: "//" + this.leftEntity + this.leftConstraint,
        count: true,
        filter: schema,
        callback: dojo.hitch(this, function (objs, count) {
            this.leftObjs = objs;
            this.setMaxPages(count);
            callback && callback();
        }),
        error: function (err) {
            console.error("Error getObjects //" + this.leftEntity + this.leftConstraint + " : ", err);
        },
        nocache: false
    });
answered
1

For simplicity, here is a code snippet, per my example:

,references : {
     "Administration.Account_Seller" : { }
}
answered