Solved

Ext JS grid wont update for me with this script

Posted on 2010-11-16
1
381 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Column Spacing 3 92
javascript to html map 8 94
Linux Scripting 3 144
Some AHK commands fail in Microsoft OneNote 5 59
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. 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 : Go t…

860 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