我想用 Ext.data.Request 向我的服务器发送请求。但我不知道该怎么做?!
我想按下提交按钮并发送请求以将数据插入我的数据库。插入由其他页面管理!
感谢帮助:)
也许你的意思是Ext.Ajax.request?我认为Ext.data.Request不是你需要的。
代码将如下所示:
new Ext.Button({
text: "My button with Ajax",
handler: function () {
Ext.Ajax.request({
url: 'foo.php',
success: function (){alert('All good!');},
failure: function (){alert('Fail...');},
headers: {
'my-header': 'foo'
},
params: { foo: 'bar' }
});
}
})