PixelMuse
asked on
ExtJS, issues with trying to create a datastore
I have the following code and it's always failing. What is the best way to provide a detailed error message so I can see what the issue is?
function createDataStore(){
var url = GLOBAL_URI + '/Users';
myNamespace.UserDataStore = new Ext.data.JsonStore({
url: url,
root: 'Subscriptions',
id: 'userId',
fields: [{
name: 'userId'
}, {
name: 'userName'
}]
});
var objUser = {
"userId": "",
"Id": ""
};
myNamespace.UserDataStore.proxy.conn.jsonData = objUser;
myNamespace.UserDataStore.proxy.conn.method = 'POST';
myNamespace.UserDataStore.load({
callback: function(records, o, s){
if (!s)
Ext.MessageBox.show({
title: 'Error',
msg: 'POST method failed',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
else
Ext.getCmp('ddlUserId').setValue(userId);
}
});
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Any thoughts on ways to solve that?