1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    83
    Vote Rating
    0
    koolll is on a distinguished road

      0  

    Default Unanswered: Bind data to list by using JSONP

    Unanswered: Bind data to list by using JSONP


    i am new for sencha touch . I need to load data from my server and bind to the list by using JSONP
    Here is my code

    Store.js


    Code:
    Ext.define('bluebutton.store.BlueButton.MemberList', {    extend: 'Ext.data.Store',   requires: [   //        'bluebutton.model.BlueButton.MemberList''Ext.data.Store','Ext.data.proxy.JsonP','Ext.data.JsonReader','Ext.data.reader.Json'    ],    config: {           storeId :'memberlist',           fields: ['age', 'name', 'messages'],           autoLoad:true,           pageSize: 5,           clearOnPageLoad: false,           proxy: {              type: 'jsonp',              url: 'http://192.168.251.131:8080/WebCommon/TestServlet',              reader: {                type: 'json',                rootProperty: 'User',              },          listeners: {            success: function(response) {            alert(response);            }        }        },           autoLoad: true,//            data: [{//           
    // // }] }});List.js

    Code:
    Ext.define('bluebutton.view.BlueButton.MemberList', {    extend: 'Ext.dataview.DataView',    xtype: 'memberlistcard',    requires: [        'Ext.field.Select',        'Ext.field.Search',        'bluebutton.view.BlueButton.MemberDetail',         'Ext.plugin.ListPaging',        'Ext.plugin.PullRefresh',        'Ext.data.Store',         'Ext.data.proxy.JsonP',         'Ext.Ajax'    ],    config: {        styleHtmlContent: true,        scrollable: 'vertical',         store : { xclass : 'bluebutton.store.BlueButton.MemberList'},//        grouped: true,//        indexBar: true,//       disclosure: true,       cls:'customHeader',//       plugins: [//                   //                        { xclass: 'Ext.plugin.PullRefresh',//                            refreshFn: function() {             //                            Ext.getStore('memberlist').load();//                },//                    //                     }//                ],        id :'memberlist',        items: [        ],        emptyText: '<p class="no-search-results">No member record found matching that search</p>',        itemTpl: Ext.create(            'Ext.XTemplate',            '<div class="tweet-wrapper">',                '<table>',                    '<tr>',                        '<td rowspan="2" width="28%" >',//                        '<div style="padding-left: 30px;">',//                        '   <img src="{imgUrl}" width="140" height="130" /></div>',                        '</td>',                        '<td>',                        '   <div class="tweet">',                        '       <h2>{age}</h2>',                         '      <h3>Name: {name}</h3>',                        '       <h3>Point Avalaible : {messages} , Last Visited : {messages}</h3>',                        '   </div>',                        '</td>',                    '</tr>',                '</table>',            '</div>'        ),    },});
    "http://192.168.251.131:8080/WebCommon/TestServlet" return format
    Code:
    "{\"User\" {\"age\" : \"29\", \"name\" : \"mkyong\", \"messages\" : \"messages\"}"
    But the list return me empty item. Please guild me some example .DId i lost anything?

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Answers
    101
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    You might want to consider reposting your code. It seems that the format got munged.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar