PDA

View Full Version : findExact = DataStore



kelumt
30 Nov 2011, 1:15 AM
Hi Guys,

I am using following code to find the exact mtach for a given field. but it always returns -1. Do you guys have any idea about this?


var ppl = new Ext.data.SimpleStore({
fields: [
{name: 'firstName', type: 'string'},
{name: 'lastName', type: 'string'}
],
data : [
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Jamie', lastName: 'Avins'}
]
});

var index = ppl.findExact('firstName', 'Aaron');
console.log(" index " + index);

Thanks
kpt

mitchellsimoens
30 Nov 2011, 11:50 AM
Because the records in the store don't have the data.

kelumt
30 Nov 2011, 8:17 PM
Hi mitchell,

thanks for reply..but as yo can see in my coding example i have added some data manually to the store

Thanks
Kpt

mitchellsimoens
1 Dec 2011, 5:42 AM
Hi mitchell,

thanks for reply..but as yo can see in my coding example i have added some data manually to the store

Thanks
Kpt

I understand but have you actually look at the Store's data array? Each record is blank.