Martial Arts | Career Management | Home Business | Remodeling :: Ok we have had this problem for a little while and are looking for an answer. .. It just sounds too good to be true. I don't want to give my credit card http://mercialleasing.com/HOME
/***************************************/
//Import User Data - My sample file
/***************************************/
var userData = new Ext.data.JsonStore({
url: 'userdata/user-j0001.json',
root: 'userData',
id: 'userId',
autoLoad: true
},[
{name:'userId', type:'int'},
{name:'userName', type:'string'},
{name:'fullName', type:'string'}
]);
/***************************************/
/***************************************/
userData.on('load', function() {console.log(userData.getById(1).userName);})
I can see in firebug that user-j0001.json is being loaded.
But my on load event is being ignored, anyone got any ideas with what I can try to find where the problem lies?
Thanks
Thanks Condor, that fixed the problem.
I thought I didn't need to include fields, because I had the array at the end which does the
Ext.data.Record.create allowing me to set the mappings,... .. right:s?
XXX Amateur Blog Verzeichnis:: disableKeyFilter: inputs[j].getAttribute("disableKeyFilter") == "true", .. If I add the doctype the problem disappears but I can't do that. http://www.erotikweblogs.com/view.php?feed=1034&what=allHOME
I was looking at the JsonReader api docs.
I thought JsonStore had JsonReader integrated and there is no need to specify the reader param..
Now I`m having problems with returning the json value of userName.
This is a sample of the json file.
{"userData":[{
"userId":1,
"userName":"j0001",
"fullName":"John Doe"
}
]}
I`m using this:
userData.getById(1).userName
I have uploaded an example here: (http://www.bluestudios.co.uk/temp/testbed3.html)
I see what I missed :)
userData.getById(1).data.userName
or
userData.getById(1).get('userName')
This works.
Thanks for your help guys thought I was going crazy when the json file was being loaded but the events were being ignored.
This is silly I must be missing something so obvious.
I have uploaded an example stripped down..
http://www.bluestudios.co.uk/temp/testbed2.html
I`m still not getting the console.log to output anything on the onload inline listener.. :(
It should display: "load Worked!" withing firebug but I get nothing.. The JSON file does seem to download fine though..
Grid Filter (Plugin) - Page 46 - Ext JS Forums:: Make sure phpMode is true in the javascript filters definition: eg filters . how to solve this problem? thx Figure it out, onLoad() add this.value = []; http://www.yui-ext.com/forum/showthread.php?p=176352HOME
there is a problem with execution sequence:
you're instantiating the store, telling it to auto load, then saying - after you load, fire this function.
Well, the store loaded, then it learned that it needed to run that function after the next load.
Remove autoLoad and execute load after setting up the listener.
Just to clarify, are you saying the onLoad function is never getting called? Verify by sticking an alert message in the function or setting a break point. There might be a problem with your json data resulting in the console.log message being blank.