Question

I built a edgeToEdgeStoreList and it works. Now I want sort the items or filter it by label. I have setted the parameter query as :

var sampleStore = new Memory({data:listini_data, idProperty:"label"});
storeElencoListiniClienti = new EdgeToEdgeStoreList({store:sampleStore,query:{label:/1$/}}, "ulElencoListiniClienti");
storeElencoListiniClienti.startup();

but it displays all the items and not only those label ending in '1'. Why? How i set a correctly query parameter for ordering items?

If i use this method:

storeOrdiniCliente.setQuery('label:/1$/');

this message is displayed on browser's console:

Error: No filter function label:/1$/ was found in store

This is listini_data:

[Object { label="1537 | IMM | 14/07/2011", codice_ordine="16537", stato_ordine="IMM", more...}, Object { label="12790 | IMM | 24/04/2012", codice_ordine="16790", stato_ordine="IMM", more...}, Object { .....
Was it helpful?

Solution

try this.Filter by label and order by att. It works for me

var sampleStore;
        require([
                 "dojo/store/Memory",
                 ], function(Memory){
            sampleStore = new Memory({data:ordini_cliente_data, idProperty:"label"});
        });
        var nl=sampleStore.query({label:/1$/}, {sort: [{attribute: "att"}]});

        storeOrdiniCliente.generateList(nl);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top