Solved

Ext JS grid wont update for me with this script

Posted on 2010-11-16
1
387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

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 …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

634 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