PDA

View Full Version : How can i access to store record's row number and checked the selection model ?



zpnd
1 Aug 2010, 7:49 AM
Hello,

My store have a selection model ( for checkboxes on each row ) and i need to check row's checkbox when condition is true. What i need for this ?



userBasket.store.on('datachanged',function(){
userBasket.store.each(function(record){
if(record.data['basket.waitingPayment']){
// check the checkbox
}
});
});

j-joey
1 Aug 2010, 2:19 PM
if you're using CheckBoxSelectionModel, you can just add the records to selection. for example:


userBasket.store.on('datachanged',function(){
var records = [];
userBasket.store.each(function(record){
if(record.data['basket.waitingPayment']){
records.push( record );
}
});
userBasket.getSelectionModel().selectRecords( records );
});

Justin.Parmar
25 Aug 2010, 10:56 PM
i am getting error with this,

var records = [];
records.push(this.getGrid().getStore().getAt([0]));
myGrid.getSelectionModel().selectRecords(records);

i am getting error :

this.grid is undefined
var ds = this.grid.store; ext-all-debug.js (line 71211)