dstore

How to apply multiple filters on a dstore?

拈花ヽ惹草 提交于 2020-02-25 09:21:08
问题 Let's say that a dstore has records with First name, Last name and Age. Now, I want records with First name as "Name1" OR Age= 25. How can I do this in dstore ? If I do, recordStore.filter({name: 'Name1'}, {age: 25}); then it returns the records having name as "Name1" AND Age=25. Another question, in the records of my dstore , there is an array also (comprising of colours). I want to filter the results based on the colours selected by the user. The problem that I face is that dstore.filter()

How to apply multiple filters on a dstore?

こ雲淡風輕ζ 提交于 2020-02-25 09:19:30
问题 Let's say that a dstore has records with First name, Last name and Age. Now, I want records with First name as "Name1" OR Age= 25. How can I do this in dstore ? If I do, recordStore.filter({name: 'Name1'}, {age: 25}); then it returns the records having name as "Name1" AND Age=25. Another question, in the records of my dstore , there is an array also (comprising of colours). I want to filter the results based on the colours selected by the user. The problem that I face is that dstore.filter()

dgrid custom sort issue

荒凉一梦 提交于 2020-01-07 02:50:07
问题 I'm trying to override the sort logic in dgrid as suggested by kfranqueiro in this link - https://github.com/SitePen/dgrid/issues/276. I get the data from the server in sorted order and just want to update the UI of column header. I'm doing this - On(mygrid, 'dgrid-sort', lang.hitch( this,function(event){ var sort = event.sort[0]; var order = this.sort.descending ? "descending" : "ascending"; console.log("Sort "+ this.sort.property + " in " +order+" order."); event.preventDefault(); mygrid

How to find items that are in one dstore collection but not in another?

北城余情 提交于 2020-01-06 13:53:49
问题 Suppose I have two dstore collections: value1 and value2. I want to find out what items are in value1 but not in value2. So something like this: var filterCollection = value1.filter(function(item) { return value2.notExists(item); }); But "notExists" function, well, doesn't exist. How do I make this logic work? 回答1: As this feature is not included by default in dstore , you can write your own function for comparing the content of your dstores and use the result as you wish. Here a generic

How can I filter a dstore using the contains method?

邮差的信 提交于 2019-12-22 13:48:11
问题 I have a dgrid populated with a dstore plain old Memory collection, that I am trying to filter using the 'contains' filter method. The store data looks something like this: [ {id:"25", users: ["13", "15"]}, {id:"347", users: ["13"]}, {id:"653", "users":["13", "17"]} ] I want to retrieve all the records where a given user is in the users array. From my understanding, I was expecting to be able to set up a filter like new Filter().contains('users', '15'); and set that as the collection for the

dgrid 0.4.0 tree looks flat before user interacts

雨燕双飞 提交于 2019-12-20 04:53:32
问题 Trying to use dgrid 0.4.0 to display a tree structure. (no prior experience with previous versions 0.3.x). I built this sample with two folders : alice and bob ; each would have a few files (leaves) in it. The store ("astore.js") define(['dojo/_base/declare', './dstore/Memory', './dstore/Tree'], function(declare, Memory, Tree) { var store = new (declare([Memory, Tree], {}))(); store.add({node:'bob', id:1, parent:null, hasChildren:true}); store.add({node:'alice', id:2, parent:null, hasChildren

How can I filter a dstore using the contains method?

£可爱£侵袭症+ 提交于 2019-12-06 08:51:46
I have a dgrid populated with a dstore plain old Memory collection, that I am trying to filter using the 'contains' filter method. The store data looks something like this: [ {id:"25", users: ["13", "15"]}, {id:"347", users: ["13"]}, {id:"653", "users":["13", "17"]} ] I want to retrieve all the records where a given user is in the users array. From my understanding, I was expecting to be able to set up a filter like new Filter().contains('users', '15'); and set that as the collection for the grid, leaving one row (id = '25') in this example. However, I am left with 0 rows. I have also tried

dgrid 0.4.0 tree looks flat before user interacts

走远了吗. 提交于 2019-12-02 04:10:58
Trying to use dgrid 0.4.0 to display a tree structure. (no prior experience with previous versions 0.3.x). I built this sample with two folders : alice and bob ; each would have a few files (leaves) in it. The store ("astore.js") define(['dojo/_base/declare', './dstore/Memory', './dstore/Tree'], function(declare, Memory, Tree) { var store = new (declare([Memory, Tree], {}))(); store.add({node:'bob', id:1, parent:null, hasChildren:true}); store.add({node:'alice', id:2, parent:null, hasChildren:true}); store.add({node:'thesis', id:3, parent:1, hasChildren:false}); store.add({node:'game', id:4,