浏览 276 次
|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
时间:2008-07-18
Grid 的JsonStore有配置如下:
{
baseParams:{cid:123}
}
我在按钮A中的事件有如下代码: this.store.baseParams.title = 'abc';
this.store.load({params:{start:0,limit:25}});
参数cid=123,title = abc被提交. 我在按钮B中的事件有如下代码: this.store.baseParams = {};
this.store.baseParams.cid = 123;
this.store.load({params:{start:0,limit:25}});
结果还是参数cid=123,title = abc被提交,但这样写又是可以的: this.store.baseParams.title = null; 只有cid = 123 被提交。 我在ext-all-debug.js中找到这句: var p = Ext.apply(options.params || {}, this.baseParams);
在此句前 加入 alert(Ext.encode(this.baseParams));结果是:{cid=123} 在此句后 加入 alert(Ext.encode(p));结果是:{cid=123,title = 'abc'} options.params是等于{start:0,limit:25}的,也没错。 这种情况是Ext.apply()的bug么? 声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |
|
时间:2008-07-18
this.store.baseParams = {}; 相当于把baseParams中原本的title去掉了。
仅此而已 跟apply无关吧 |
|
| 返回顶楼 | |
|
时间:2008-07-18
想象力真好
|
|
| 返回顶楼 | |
|
时间:2008-07-19
kimmking 写道 this.store.baseParams = {}; 相当于把baseParams中原本的title去掉了。
仅此而已 跟apply无关吧 你仔细看我的帖子没有啊? 我之所以写this.store.baseParams = {}这句,目的就是为了清空它。 我问的是:在 Ext.data.Strore.load()中, var p = Ext.apply(options.params || {}, this.baseParams);
这句之前options.params和this.baseParams中都没有'title'值,执行这句之后p中怎么就有title值了呢? |
|
| 返回顶楼 | |






