SharpCoder
SharpCoder

Reputation: 19163

Finding record by multiple fieldNames in ExtJs store

If I need to find a record in EXTJS store, I typically use findRecord method. It takes the name of the field and the value you want to search.

myStore.findRecord('EmployeeID', rec.empId);

But what If I want to search store for a record based on multiple fields. Lets say I want to search record by Employee ID and Employee Departamet ID

I am using ExtJs 4.1

Upvotes: 1

Views: 8448

Answers (1)

Gad
Gad

Reputation: 42306

Use findBy and pass a custom function

http://docs.sencha.com/extjs/4.2.2/?mobile=/api/Ext.data.Store#method-findBy

Upvotes: 2

Related Questions