PDA

View Full Version : Sencha Touch store not loading



shruti_nair
21 Feb 2012, 12:09 AM
in my application i need to use a store named LoginStores in my controller

but whatever i do i get 2 errors

1.Attempting to create a component with an xtype that has not been registered: [object Object]
2.TypeError: 'undefined' is not an object (evaluating 'LoginForm.store.LoginStores')


code:User.js

Ext.regController('Users', {


login:function(options)
{
//store:['LoginStores'];
var store = LoginForm.store.LoginStores;
this.setStore(store);


var user=options.user;
var pass=options.pass;
alert("user name="+user);
console.log("inside controller");



code:LoginStores.js


LoginForm.stores.LoginStores =Ext.create('Ext.data.Store',{
//console.log("inside store")
// store configs
id:'LoginStores',
autoLoad:true,
storeId:'LoginStores',

model:'Receipt',

proxy:
{

type:'jsonp',
url: 'http://expensetrackingapplication.com/cocacola/webservices/test.php',
params:{
login:'test',
password:'test'
},
callbackKey: 'callback',
callback: function (response)
{

if(response.result == true)
{
LoginForm.views.viewport.reveal('Home');
}
else
{
alert("Login failed");
}
}


}



});

code:model.js

LoginForm.models.Receipt =Ext.regModel('Receipt', {
fields: [
{name: 'result', type: 'boolean'},

]
});



result from test1.php
{"result":false}

Plz help!!!
Thanks
Shruti_nair

shruti_nair
21 Feb 2012, 12:25 AM
Ext.regController('Users', {

store:'LoginForm.store.Loginstores',

login:function(options)
{
//store:['LoginStores'];


var user=options.user;
var pass=options.pass;
alert("user name="+user);
console.log("inside controller");
}

});


still get the first error