PDA

View Full Version : Store generated by Ext Designer



marcn44
19 Apr 2010, 7:14 AM
I bougth Ext Designer one month ago. generated code is the one I usually use buildin ExtJs app. For example, I've set up a store



/*
* File: LaboStore.js
* Date: Mon Apr 19 2010 07:23:17 GMT+0200 (Paris, Madrid (heure d'été))
*
* This file was generated by Ext Designer version xds-1.0.0.8.
* http://www.extjs.com/products/designer/
*
* This file will be auto-generated each and everytime you export.
*
* Do NOT hand edit this file.
*/

LaboStore = Ext.extend(Ext.data.JsonStore, {
constructor: function(cfg) {
cfg = cfg || {};
LaboStore.superclass.constructor.call(this, Ext.apply({
storeId: 'MyStore',
baseParams: {pDate :'',pHeure:''},
autoLoad: true,
root: 'data',
url: 'http://www.mi2l.net/$EJS310/$Labos/data.php',
fields : [
{
name: 'Ligne',
type: 'string'
}
]
}, cfg));
}
});
new LaboStore();

If "autoload" is true, every thing is OK but I want to trigger store loading (changing parameters ...)

I've tried : LaboStore.load({params:{start:0,limit:30,pHeure:'10'}});
but I received the message "LaboStore.load is not a function"

What is the syntax to load a store defined as shown ?

Excuse my english, thank's for your help et congratulation for this beautiful product.

Marc

aconran
19 Apr 2010, 4:11 PM
LaboStore is a JavaScript class. Because you have provided a storeId to your class you can retrieve it and load it via the StoreMgr.



var ds = Ext.StoreMgr.lookup('MyStore');
ds.load({params:{start:0,limit:30,pHeure:'10'}});

marcn44
19 Apr 2010, 9:07 PM
Hi Aaron,

Naturally, that works. Thank you for having helped me. It is fantastic to create a product like ExtDesigner and help the users to take it in hand.

I see that I have to make progress in JS and learn the classes, It is very kind to help the new users.
Thank you for the time you spend to support !

Greetings from Switzerland.

Marc

PS : I've read "Learning Ext JS" and "Ext JS Cookbook" but thy don't cover the basis of JS ...

VinylFox
28 Apr 2010, 12:14 PM
For basic JavaScript I would suggest "Object-Oriented JavaScript (https://www.amazon.com/dp/1847194141?tag=viny07-20&camp=213381&creative=390973&linkCode=as4&creativeASIN=1847194141&adid=1FMVD1DBC4H386RG9MW2&)" by Stoyan Stefanov.

marcn44
29 Apr 2010, 9:09 AM
Thank's for the suggestion VinylFox, It is always valuable to have advice from specialists,

Marc