0

I am new to sencha touch can any one help me, what is the way to get data from server. I didn't understand clearly. Please help me. In need to display the values from server to grid. I dont how to do that.Now I have added the values directly to grid store.

lakshmi
  • 4,539
  • 17
  • 47
  • 55

3 Answers3

1

You should dive deeper into two aspects of Sencha Touch: models and stores. A model is simply a representation of an object. For example, you could define 'User' as a model with the fields 'id', 'username', 'email'. Stores can be seen as collections of model-objects.

The beauty of Sencha is that the models / stores can be given a proxy parameter. There are various proxies available, but you should choose the one that suits application the best. For example, the AjaxProxy sends a request to the server to load the data. Once your store is loaded (please not that AJAX calls are made asynchronous) you can populate it in for exampe a List or NestedList.

Some example code, directly taken from the docs:

Ext.regModel('User', {
    fields: ['id', 'name', 'email']
});

//The Store contains the AjaxProxy as an inline configuration
var store = new Ext.data.Store({
    model: 'User',
    proxy: {
        type: 'ajax',
        url : 'users.json'
    }
});

store.load();
Martijn
  • 5,491
  • 4
  • 33
  • 41
  • Hey pls see this...http://stackoverflow.com/questions/9563417/how-to-consume-soap-web-service-in-sencha-touch. and try to answer it... – himanshu Mar 06 '12 at 11:30
0

Download the SDK of sencha touch2 and then you can refer example which is present in sencha sdk for using the servers. This is important to use web services for getting data from servers.

Just refer to the below link.

sencha-touch-2.0.1.1\examples\ajax

gnat
  • 6,213
  • 108
  • 53
  • 73
Saurabh
  • 955
  • 6
  • 14
  • 22
0

you can use this tutorial. it's very useful

http://programmersgoodies.com/how-to-parse-xml-response-with-sencha-touch#comment-27

lady android
  • 217
  • 3
  • 4
  • 9
  • Hey pls see this...http://stackoverflow.com/questions/9563417/how-to-consume-soap-web-service-in-sencha-touch. and try to answer it... – himanshu Mar 06 '12 at 11:30