1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    Ekjyot is on a distinguished road

      0  

    Default Unanswered: Result of expression 'a' [undefined] is not an object. sencha-touch.js

    Unanswered: Result of expression 'a' [undefined] is not an object. sencha-touch.js


    I am making an app in sencha 1 in which i am making a post request to server in datastore and then using that datastore in list .
    But it is giving me the below

    TypeError: Result of expression 'a' [undefined] is not an object. at file:///android_asset/www/touch/sencha-touch.js:6

    my code is as follows:

    Ext.setup( { tabletStartupScreen : 'tablet_startup.png',
    phoneStartupScreen : 'phone_startup.png',
    icon : 'icon.png',
    glossOnIcon : false,


    onReady : function() {
    Ext.regModel('Principle', {
    fields : [ 'name', 'type', 'id' ]
    });


    console.log("hi1");
    var principleStore = new Ext.data.Store( {
    autoLoad : true,
    storeId : 'principleStore',
    model : 'Principle',
    sorters : 'name',
    getGroupString : function(record) {
    return record.get('name')[0];
    },
    proxy : {
    type : 'ajax',
    fields : [ 'name','pages', 'type', 'id' ],
    url : 'http://apps.hds.com/ebook/apps_user_ebooks.jsp',
    actionMethods: {
    create: 'POST',
    read: 'POST',
    },
    // method:'post',
    params:{
    username:username,
    password:password
    },
    reader : {
    type : 'json',
    root : 'ebooks'
    },success : function(result) {
    console.log("success");
    alert(result.responseText);
    }
    }


    });
    console.log("success");
    alert(principleStore)
    var principlesList = new Ext.List( {
    itemId : 'principlesList',
    store : principleStore,
    renderTo : 'list',
    itemTpl : '<div><strong>{name}</strong></div>',
    singleSelect : true,
    grouped : true,
    indexBar : true,
    simpleSelect : true,
    floating : false,
    height : 286,
    width : 300,
    centered : true,
    hideOnMaskTap : false,
    itemCls : 'item-select',
    selectedItemCls : 'item-selected',
    pressedCls : 'item-pressed',
    listeners : {
    itemtap : function(e, item) {
    selectedItemName = this.store.data.items[item].data.name;
    selectedItemId = this.store.data.items[item].data.id;
    selectedItemtype = this.store.data.items[item].data.type;
    }
    }
    });
    if (Ext.is.Phone) {
    } else {
    }
    principlesList.show();
    }


    });

    Can anyone please tell me how to overcome this problem.

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Where in your code is it happening?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.