PDA

View Full Version : Grid search from togglehandler



mayurid
1 Sep 2010, 3:43 AM
hi,
i have written a factory function to print alphabets and added togglehandler to it: i want the store to load on click of the particular albhabet, i am not getting the scope of store, how to get it?:

getLetter = function letters() {
var items = [];

for (var i = 65; i <= 90; i++) {
//
items.push({
text: String.fromCharCode(i),
enableToggle: true,
toggleGroup: 'AZsearch',
toggleHandler: buttonToggleHandler,
scope: this,

}, '', '-', '');

}
for (var i = 49; i <= 57; i++) {
items.push({
text: String.fromCharCode(i),
enableToggle: true,
//store:this.store,
toggleGroup: 'AZsearch',
toggleHandler: buttonToggleHandler,
}, '-', '');
}
return items;
}
buttonToggleHandler = function (button, state) {
if (state == true) {
var abc = button.text;
alert(getStore);
ds.load({
params: {
task: 'alpha_search'
}
});
}
}I am using it like this:

var alpha_letter=new getLetter();tbar:{alpha_letter}