PDA

View Full Version : Cant Load Datastore into Grid dynamically



smarmysam
15 Nov 2010, 8:43 AM
My grid wont change when i allocate the datastore dynamically, but when i assign the same datastore in the initial gui declration it works !


function loadEmployee(id){
var ds = new Ext.data.Store({
autoLoad: true,
url: 'query.php?page=4&employee='+id+'&records=10',
reader: new Ext.data.XmlReader({
record: 'leaverequest',
}, ['leave_type', 'employee', 'start_date', 'end_date', 'approver', 'date_requested']),
sortInfo: {
field: 'employee',
direction: "ASC"
},
listeners: {
'load': function(){

var grid = Ext.get('leave_history_grid');
grid.ds = this;
grid.show();
alert("Loaded");
}
}

});

}