Link to home
Start Free TrialLog in
Avatar of SilentSamuel
SilentSamuelFlag for Australia

asked on

Ext JS grid wont update for me with this script

The grid wont load the datastore, but if i load the datastore into the grid at the start, it works!

Why? :)
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");      
      }
     }
                    
                });
    
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SilentSamuel
SilentSamuel
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial