Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Where in your code is it happening?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •