Solved

Ext JS grid wont update for me with this script

Posted on 2010-11-16
1
375 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

771 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

13 Experts available now in Live!

Get 1:1 Help Now