I am working with a Tree Store and trying to filter out nodes that have a "Status" property as "Confirmed". If so, I keep the node in the tree and I am attempting to keep the children of that node as well. The root nodes are "Conferences" and the children are "Events".
That console.log outputs true for the records that are 'Events' and outputs false only for the conferences with Status as not "Confirmed". As events don't have a Status property. Which is why I put in the workaround of passing always true for Event nodes. However, the second any of the Conferences get filtered out, then no child nodes will exist anywhere in the tree, even though the console.log dumps out true for the Event records. I even set a Status property for the Event children to "Confirmed" and even then they got removed if even 1 conference was filtered out.
TreeGrid - TreeStore filterBy Removes all child nodes when return is true
My custom function in filterBy returns this
Code:
eventListingTree.getStore().filterBy(function(record, id){
console.log(record.get('Status') == status || record.get('type') == 'Event');
return (record.get('Status') == status || record.get('type') == 'Event');
});
That console.log outputs true for the records that are 'Events' and outputs false only for the conferences with Status as not "Confirmed". As events don't have a Status property. Which is why I put in the workaround of passing always true for Event nodes. However, the second any of the Conferences get filtered out, then no child nodes will exist anywhere in the tree, even though the console.log dumps out true for the Event records. I even set a Status property for the Event children to "Confirmed" and even then they got removed if even 1 conference was filtered out.
I do not understand what is going wrong here. I am using ExtJS 5.0.0.970. Is this a bug or is this behavior expected?
TreeGrid - TreeStore filterBy Removes all child nodes when return is true
Aucun commentaire:
Enregistrer un commentaire