Solved

Ext JS grid wont update for me with this script

Posted on 2010-11-16
1
376 Views
Last Modified: 2012-06-22
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

0
Comment
Question by:SilentSamuel
1 Comment
 

Accepted Solution

by:
SilentSamuel earned 0 total points
ID: 34147409
lol fixed

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.getCmp('leave_history_grid');
                                     grid.reconfigure(this,grid.getColumnModel());
                                      alert("Loaded");      
                                    }
                              }
                   
                });
   
}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now