【问题标题】:Consume web service in sencha touch?在 sencha touch 中使用 Web 服务?
【发布时间】:2013-09-11 14:46:59
【问题描述】:

我是 sencha touch 2 开发的新手。

我的疑问是:-

1)如何在sencha touch 2中使用webservice?

2)如何将参数传递给 webservice 方法作为该服务方法的输入?

我请求你帮忙。

任何参考资料或教程都会对我有很大帮助。

提前致谢。

【问题讨论】:

    标签: sencha-touch extjs sencha-touch-2


    【解决方案1】:

    假设这就是您所说的,这里有一个很好的入门教程:http://miamicoder.com/2012/how-to-create-a-sencha-touch-2-app-part-1/

    我个人使用带有 AJAX 代理的 PHP/MySQL 后端

    【讨论】:

    • 我已经浏览了这个链接,但他们不知道如何使用服务。
    【解决方案2】:

    我使用 ajax 请求来实现这个目标,如下所示:

            var resp = Ext.Ajax.request({
            method: 'post',
            url: url,
            jsonData: {
                'method' : 'Product.search',
                'params' : {
                    'pageSize' : 20,
                    'pageIndex' : 0
                }
            },
            async : true,
            success : function(response, options){
                var sResult = Ext.decode(response.responseText);
                Ext.Array.each(sResult['result']['datas'], function(obj){
                    productModel = Ext.create('transport.model.Product', obj);
                    productStore.add(productModel);
                });
                callback();
            },
            failure : function(response, options){
    
            }
        });
    

    【讨论】:

      猜你喜欢
      • 2013-09-04
      • 1970-01-01
      • 2012-08-11
      • 1970-01-01
      • 2012-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多