我想在检查不同的单选按钮时重新加载我的网格,但是使用我想提供给网格的新 url 以在网格内提供不同的不同列..
这是我的单选按钮,我想在其中为我的网格提供不同的 url。
{
boxLabel: ' 1', name: 'rb-horiz-3', inputValue: 1,
listeners: {
check: function(){
//what i write here to
// reload grid with different url ....
}}
}
这是我的网格..
{
xtype:'grid',
store:new Ext.data.JsonStore({
id:'store_id',
root:'result',
totalProperty:'total',
fields:[
{name:'rank'},
{name:'pg'},
],
baseParams:{start:0,limit:20},
url:'pgrouting!getGridData.action',//this i want to change on checking of radio button...
autoLoad:true,
method:'POST'}
最佳答案
正如@MMT 在评论中所说,将绑定(bind)的代理 的url 设置为新url,然后执行负载 的商店。
check: function(){
var url = http://example.com/data; // set the specific url
// what you need here is a reference to your grid or store
var store = grid.getStore(); // get the store from the grid
var proxy = store.getProxy(); // get the proxy from the store
proxy.setUrl(url); // change the url of the proxy
store.load(); // load the new data
}}
您在检查监听器中需要的是对网格或网格存储的引用。
关于javascript - 如何通过向网格提供不同的 url 来重新加载网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32248320/