Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in building Sencha Touch 2 application

While I am building my sencha touch 2 app using the command:- sencha app build production

but it throws an error:

[INFO] Deploying your application to /Applications/MAMP/htdocs/iPadapp/build/production
[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[INFO] Copied resources/css/app.css
[INFO] Copied resources/images
[INFO] Copied resources/icons
[INFO] Copied resources/loading
[INFO] Resolving your application dependencies...
[ERROR] Error thown from your application with message: TypeError: 'undefined' is not an object

I traced the error in my code . I found out , it is due to loading my list. Here is my code

Ext.define("myProject.store.Members",{
    extend  :'Ext.data.Store',
    requires:"Ext.data.proxy.LocalStorage",
    config: {
        model   :"myProject.model.Member",
        sorters :'lastName',
        autoload:true,

        proxy: {
            type: 'localstorage',
            id  : 'mainStore'
        } 
    }
});

if I remove the line 'autoLoad: true' ( which breaks my application, then I can build the application. But my list is not loading. If I put it back the error repeats. I tried dynamically loading the list with load function , but it does not make any sense.

And here is the model.js file I amusing.

Ext.define('myProject.model.Member', {
    extend: 'Ext.data.Model',
    config: {
        fields: [
            'index',                 
            'email',
            'firstname',
            'lastname',
            'phone',
            'currentemployer',
            'currenttitle',
            'interestlevel',
            'tcgroupNames',
            'active',
            'lastlogin',
            'usertypedesc',
            'recruiternotes',
            'recruitercontact',
            'addtype',
            'usertypedesc',
            'jobtitle',
            'ipAddress',
            'recruitersource',
            'agentkeywords',
            { name: "created", type: 'date' },
            'recruiterprofileurl_linkedin',
            'recruiterprofileurl_facebook'
        ]
    }
});

Any Help is appreciated

Happy coding to all

like image 444
heyjii Avatar asked Apr 26 '12 04:04

heyjii


People also ask

Is Sencha Touch HTML framework?

Sencha Touch is a popular framework of Sencha for creating a user interface for mobile applications. It helps the developer create a mobile app using simple HTML, CSS, JS which supports many mobile devices such as android, IOS, BlackBerry, and Windows. It is based on MVC architecture.

What is the command to upgrade a Sencha version from CMD?

Please run "sencha app upgrade" to update to 4.0. 2.67.

What is the use of Sencha CMD?

Sencha Cmd provides a workspace and package management system that assists in sharing framework code, packages, and custom code across multiple applications. You can easily integrate packages from the Sencha Package Repository or any other packages created by the Sencha community.


1 Answers

I have the same issue, the command builder isn't allowed to open a connection to localstorage so it crashes.

You should be able to set Ext.getStore('Members').setAutoLoad(true); in the launch: function () { of app.js.

Then your app will build and should still load the data into the store.

like image 160
Adam Marshall Avatar answered Oct 04 '22 07:10

Adam Marshall