Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Ext JS grid wont update for me with this script

Posted on 2010-11-16
1
Medium Priority
?
389 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The viewer will learn how to count occurrences of each item in an array.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

772 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