我已经从Sencha Touch学习中心的GeoTweets教程中获取了代码,它工作得很好。我到了一个点,我想要一个表单与提交按钮发送新的请求JSON服务器与更改参数。有没有人可以引导我走向正确的方向,在谷歌上搜索了一点,但找不到任何与Sencha Touch一起工作的东西。
下面是我请求的代码:
Ext.util.JSONP.request({
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function(data) {
console.log(data.results);
var tweet_list = data;
timeline.update(tweet_list); // Update the tweets in timeline
}
});
};
我想做的就是用新的参数重新加载JSONP
just have
var config = {
url: 'http://myserver/testdetails.php',
callbackKey: 'callback',
params: {
q: "bored",
rpp: 30,
uniqueify: Math.random()
},
callback: function(data) {
console.log(data.results);
var tweet_list = data;
timeline.update(tweet_list); // Update the tweets in timeline
}
}
,然后像这样修改参数
config.params = {q:"amused", rpp:20, uniqueify: Math.random()};
然后发出这样的请求
Ext.util.JSONP.request(config);