开发者

Sencha touch getting text into textarea

开发者 https://www.devze.com 2023-04-13 07:18 出处:网络
I am using sencha touch to query a web server which returns text data. my current code is the following:

I am using sencha touch to query a web server which returns text data.

my current code is the following:

Ext.Ajax.request({
    url: 'get/log',
    method: 'GET',
    success: function (result, request) {

                alert("Success");
                Ext.getCmp('logText').setValue(request)

    },
    failure: function (result, request) {

        alert("FAILED");
        Ext.getCmp('logText').setValue(request)
    }
});

This is not working as expected as I'm seeing [object Object] in the text area.

The server is sending the following (as a example).

[17 Oct 10:41:53] Beaco开发者_如何学编程n off
[17 Oct 10:41:53] Beacon on

Does anybody have any advice / experience on how best to get this working.


You can get the server response in result.responseText. Anyway you should set a breakpoint in the success function and inspect what and where the server is returning.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号