Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/440.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ExtJS GridPanel向querystring添加另一个参数_Javascript_Grid_Extjs - Fatal编程技术网

Javascript ExtJS GridPanel向querystring添加另一个参数

Javascript ExtJS GridPanel向querystring添加另一个参数,javascript,grid,extjs,Javascript,Grid,Extjs,我有一个网格和一些网格外的选项。。。我的代理是对ASPX页面的POST请求 _store = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: 'resultpage.aspx?initalparam=1...', method: "POST" }), reader: _reader,... 我想要的是,当我的任何选项被选中时

我有一个网格和一些网格外的选项。。。我的代理是对ASPX页面的POST请求

_store = new Ext.data.JsonStore({
        proxy: new Ext.data.HttpProxy({
            url: 'resultpage.aspx?initalparam=1...',
            method: "POST"
        }),
        reader: _reader,...
我想要的是,当我的任何选项被选中时,将该选项添加为查询字符串参数(或post参数)并发出post请求

参考:

注意:休闲代码不起作用的只是想法。************

我正在寻找类似于:

myoption=...; //with DOM get option value
myurl = panelobj.getGrid().getStore().getProxy().getUrl();
panelobj.getGrid().getStore().getProxy().setUrl(myurl+"&myoption=" + myoption);
panelobj.Update();
或者更酷的东西,比如:

Ext.create('...ON OPTION CLICK...', append("&myoption=" + myoption); submit();..)

你在找这个吗

每个代理都有一个额外的参数,可以添加到每个请求中。

我看到了这个示例。假设ds是数据存储:

ds.proxy.getConnection().request({extraParams: { testParam2: 200 }, method: 'POST',url: ds.proxy.buildUrl()});
发出请求,但在服务器端我无法读取
testParam2
<代码>请求[“testParam2”]为空

这种方式对我不起作用(我使用版本3),所以我使用
params
,而不是
extraParams
(表单参数:POST)

另一种可能是通过url传递(QueryString参数:GET)

//************ 其他问题:

有了上面的代码,我可以提出请求。。。但它完全独立于电网。。。正在检索的数据未经处理。。。如何让网格执行请求?????我不知道

//********* 解决方案:


删除以前的网格并使用新参数添加新网格!那对我有用

我在寻找两样东西:1。添加一个额外的参数(我正在研究您提到的内容)和2。提出请求。
ds.proxy.getConnection().request({params: { testParam2: 200 }, method: 'POST',url: ds.proxy.buildUrl()});
ds.proxy.getConnection().request(method: 'POST',url: ds.proxy.buildUrl() + '&testParam2=200'});