PDA

View Full Version : TypeError: record.unjoin is not a function



rhytha268
11 Apr 2013, 3:03 AM
Getting error when loading store data After ajax request returning data.
Error - TypeError: record.unjoin is not a function
Here is my code -

var invStore = Ext.data.StoreManager.lookup('invoice');
var rec = Ext.decode(response.responseText);
invStore.loadData(rec);

tvanzoelen
11 Apr 2013, 3:21 AM
Check the rec after decode. Is it an array?
And you could try to use loadRawData if the data is not an array of models.

rhytha268
11 Apr 2013, 9:23 PM
Here is my data - and loadRawData also not working.

43095

rhytha268
11 Apr 2013, 9:49 PM
My Bad.
I should use -

var rec = Ext.decode(response.responseText).records;
invStore.loadData(rec);

That works.

Thank you

tvanzoelen
11 Apr 2013, 10:58 PM
you should put in the record array part not the rec object..