Using filter method from Data Store
Good morning everyone!
I have this piece of code to filter some json results retrieved from a database
Code:
{
xtype: 'button',
text: 'Pesquisar',
renderTo: 'alunos',
handler: function(){
load.clearFilter();
load.filter('name', Ext.getCmp("nomeAluno").getValue() , true, false );
}
}
I use this in a search field. The problem?
Let's say I want to find everyone named 'Bruno' on my database, I type 'Bruno' on the textfield, click on search and I will get a lot of Brunos
Bruno Miranda
Bruno Fonseca
Etc...
BUT if I search for Miranda, it won't return the first Bruno. It only looks up the first word of every record, but I'd like it to match "Bruno Miranda" too, if I search for "Miranda"
Does anyone have a suggestion?
Thanks in advance!
multiple column search in grid store using filter
I have a datagrid and a textfield on top of grid
If i type something in textbox it should basically match in all columns and display the result.
Right now I am using the below code by using filterby method to filter a record based on single column
var searchvalue = text.getValue();
this.getGridPanel().store.filterBy(function(record){
var name= record.data.firstname;
if(name.indexOf(value.toLowerCase()) == 0){
return true;
}
else{
return false;
}
})
Please help me as my grid has many columns and i want to search in all the columns and return if any1 is matched
I saw the above approach of filter method, but can you post some code on how to apply to my code via using filter method.