DelphiFAQ Home Search:

My extjs store does not load the data

 

comments4 comments. Current rating: 3 stars (1 votes). Leave comments and/ or rate it.

Question:

My extjs data store does not load the data. It is supposed to get the data via http from a JSP page. When I execute it manually, the JSP works.

Answer:

Check with Firefly if all the necessary arguments are passed. You can do it this way:

-1- Set a breakpoint where the store.load() call is.
-2- when you reach the breakpoint, switch to the console tab, and clear it
-3- continue execution (1 step)
-4- check the details of the post request

In your case, you had passed some parameter that was lost when the load() was executed. Below the corrected code.

It is unclear why one would bother to define the params property in the store to begin with.

var
  storeProfiles = new Ext.data.Store({
    // load using HTTP
    url: 'profilexml.jsp',
    params: ({'get_profiles':1}),

    // the return will be XML, so lets set up a reader
    reader: new Ext.data.XmlReader({
      record: 'profile',
      'profile_name': 'profile_name',
      totalRecords: '@total'
    },
    [
      // set up the fields mapping into the xml doc
        'profile_name'
    ])
  });

  // next line does NOT work:
  storeProfiles.load();

  // this does work:
  storeProfiles.load({params:{'get_profiles':1}});

Content-type: text/html

Comments:

2008-08-08, 09:26:57
[hidden] from Germany  
rating
Have a look at Store's baseParams config option: http://extjs.com/de..baseParams
2009-01-05, 10:54:17
anonymous from Cote d'Ivoire  
Hello to all.
I am a novice in developing the framework extjs. I am looking for help (tutorial, faq, documement ,...) referring to extjs and possibly French. If you can help me. I complete a project and I'm really stuck. I thank you for help.
e-mail: atsefao@hotmail.com


Keywords:
2011-12-09, 09:40:05
anonymous from Poland  
daniel.piasecki@eurozet.pl


Keywords:
2013-10-30, 07:38:52
anonymous from Poland  
KimSon


Keywords:

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: