PDA

View Full Version : jsonreader bug or fix not sure



YankeeImperialistDog
13 Nov 2009, 1:09 PM
I backed up my learning project and loaded 3.0.3. I'm getting and error in the following:


// Called as a callback by the Reader during a load operation.
loadRecords: function(o, options, success) {
if (!o || success === false) {
if (success !== false) {
this.fireEvent('load', this, [], options);
}
if (options.callback) {
options.callback.call(options.scope || this, [], options, false, o);
}
return;
}
var r = o.records,
t = o.totalRecords || r.length; < ---------error here * *****
if (!options || options.add !== true) {
if (this.pruneModifiedRecords) {
this.modified = [];
}
for (var i = 0, len = r.length; i < len; i++) {
r[i].join(this);
}
if (this.snapshot) {
this.data = this.snapshot;
deletethis.snapshot;
}
this.clearData();
this.data.addAll(r);
this.totalLength = t;
this.applySort();
this.fireEvent('datachanged', this);
} else {
this.totalLength = Math.max(t, this.data.length + r.length);
this.add(r);
}
this.fireEvent('load', this, r, options);
if (options.callback) {
options.callback.call(options.scope || this, r, options, true);
}
},


here is my JSON reader: (it goes to an MVC.net controller.)


employee_data = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: '/Junk/JunkData/' + thsId
}),
reader: new Ext.data.JsonReader({},
['Id', 'Version', 'Note']),
remoteSort: false
});


My onload is here:


employee_data.on('load', function() {
noteTextField.setValue(employee_data.reader.jsonData.Note);
versionTextField.setValue(employee_data.reader.jsonData.Version);
idTextField.setValue(employee_data.reader.jsonData.Id);
// data loaded, do something with it here...
});

I have been beating my head against the wall trying to appily indexing to my JSON data and it just refused to take it. so I droped the index and found the data this way.

I am very new to this so i figure this error is a result of a fix to something i worked around?
I'll give more info if needed. BTW the origional project with the previous library still works ok.

Thanks, i hope this can help someone

evant
16 Nov 2009, 6:53 PM
There's not really even close to enough information here.

What's the error? What data is coming back?

I'm going to move this issue to the help forum.

YankeeImperialistDog
17 Nov 2009, 6:42 AM
By all means give me a complete list of what you need. I can start with the data returned, but if this is going to turn into a back and forth (ok, now I need this, ok now I need that) I'd say you are not giving me anything close to what you really need to see what is going on. I joined EXT specifically to get help because I do not know the product.

My original post worked under the assumption that this would be a known issue under the category of: "something that worked before, but has different behavior now." This was the reason for it being posted where it was. If I understood correctly 3.0.3 is backward compatible. If there is an error now it means one of three things. My solution was a work around that is no longer valid due to new correct behavior. My solution, because Im very new to EXT, was actually incorrect but worked in spite of itself. In other words I found a hole and the hole is now plugged. My solution is fine and I found a bug.

Forgive my correction, but I think the answer you were attempting to give me was: "We can't see anything wrong with what was posted. There may be an error in your code or you may have found a bug. Either way we need more information. In future posts please provide this at a minimum: (and here you provide the minimum list or point to an article that has the list and the guidelines). On this issue can you give us the following additional information so we can both try to figure out what the problem is: (this is where you provide the list?). If we determine that there is no bug this thread should be continued in the help forum. ALT to the last: In the future you should first post issues like this to the help area with all the information requested above and if no solution or explanation is found it should then be continued here.

You have no idea at what level of a developer I am or even if I am a developer at all so you should assume I know absolutely nothing. This would be unfortunate albeit annoying to you and your team, but it happens. It sure has happened to me. Look, I understand the frustration, but here is my perspective: I just purchased support; I posted something thinking I may actually be able to contribute, and I got this response: dont bother me with your half ass issue! Go out the door, turn left, and walk into the office 99 (third door on the right). They might have time for you.