PDA

View Full Version : Trouble with data.store.load ...



pierrem
8 Aug 2010, 10:31 AM
Hi there,

I want to display an alert while data are loaded (just to try ...) and I use the code :
<code>
...[other code]...
var myStore = new Ext.data.Store
(
{
model: 'ipInfo',
sorters: 'post_title',
autoLoad: true,
proxy:
{
url: 'send_data.php',
type: 'ajax',
reader: 'json'
},
getGroupString: function(record)
{
return record.get('post_title')[0];
},
listeners:
{
load: {fn: function(){alert("Loaded");}}
}
}
);
...[other code]...
</code>

Everything works well, data are displayed in another part of the code.... but the 'alert('Loaded')' doesn't appear.
I'v also tried (from forum ...)
<code>
myStore.on('load',alert("Loaded"));
</code>
nor works.

Where is my mistake ?

Thks

evant
8 Aug 2010, 8:12 PM
There will be a "read" event fired on the store, which will be part of the next release.

pierrem
8 Aug 2010, 9:35 PM
OK,
and thanks for your great job
:)