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

      0  

    Default Unanswered: Ext.data.JsonReader.getResponseData: Unable to parse JSON returned by Server

    Unanswered: Ext.data.JsonReader.getResponseData: Unable to parse JSON returned by Server


    I need to send the request in post method in the datastore but it is giving me the below error:

    Ext.data.JsonReader.getResponseData: Unable to parse JSON returned by Server

    I am using following code:

    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',
    method:'post',
    params:{
    username:username,
    password:password
    },
    reader : {
    type : 'json',
    root : 'ebooks'
    },success : function(result) {
    console.log("success");
    alert(result.responseText);
    }
    }


    });
    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 help me to solve the problem.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,710
    Vote Rating
    436
    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


    Sencha Touch 1 or 2?
    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.

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

      0  

    Default


    Sencha Touch 1

Tags for this Thread