0
votes

I'm trying to filter a list of items using the exactMatch in order to get items with the exact ID :

This code is working fine but it returns all the items which the ID begins with the required one :

itemslist.getStore().filter('type_id',this.getType().getValue());

If the value of the type ID is 1, it returns all the elements which the type has an ID like 1XXX. But I want only the elements which the type is exactly 1.

I found a solution here so I changed the code to use the exactMatch but it doesn't work, this is my code :

itemslist.getStore().filter({
    property: 'type_id',
    value: this.getType().getValue(),
    exactMatch: true
});

Even if I delete the exactMatch line, it doesn't work and the result is empty. Could you tell me please what's the difference between these 2 ways and how to get exactMatch working ? Thanks

1
Try this : itemslist.getStore().filter(Ext.create('Ext.util.Filter', {property: "type_id", value: this.getType().getValue(), exactMatch: true})); Not sure this makes a change but sometimes... - Titouan de Bailleul
It works perfectly! Thanks a lot! - bnabilos

1 Answers

2
votes

Try this :

itemslist.getStore().filter(Ext.create('Ext.util.Filter', {
  property: "type_id",
  value: this.getType().getValue(), 
  exactMatch: true
})); 

Not sure this makes a change but sometimes...