sencha touch 2 store传参 或者 url后附加参数
2013-07-04 14:34
351 查看
me.pigFileStore.getProxy().setExtraParams({
card: Ext.getCmp('pigFileSearch').getValue(),
state:Ext.getCmp('pigFileSearchState').getValue()
});
如果想给创建好的store 附加参数的话 只有后台方法声明好参数 通过上面的方法就可以给store附加参数
下面是我创建的store
card 和state 两个属性并没有在store创建中 但是在http://192.168.10.88:8080/pigFarmTrace/mobile/mobilePigFile!phonePagedQuery.action这个后台方法中已经有了这两个参数 所以通过上面的方法在加载数据源的时候 会在url后面附加上&card ="..‘’参数
me.pigFileStore = Ext.create("Ext.data.Store", {id : 'pigFileStore',
fields : ['id','feedNumber','pigpenNumber','card','entrytime','state'],
pageSize:10,
proxy : new Ext.data.proxy.Ajax({
actionMethods : {
read : 'POST'
},
//url : totalPath + '/mobile/mobilePigPen!phonePagedQuery.action',
url:'http://192.168.10.88:8080/pigFarmTrace/mobile/mobilePigFile!phonePagedQuery.action',
reader : {
type : 'json',
rootProperty : 'data',
totalProperty : 'totalCount'
},
extraParams: {
card: ''
},
autoLoad : false
})
});
card: Ext.getCmp('pigFileSearch').getValue(),
state:Ext.getCmp('pigFileSearchState').getValue()
});
如果想给创建好的store 附加参数的话 只有后台方法声明好参数 通过上面的方法就可以给store附加参数
下面是我创建的store
card 和state 两个属性并没有在store创建中 但是在http://192.168.10.88:8080/pigFarmTrace/mobile/mobilePigFile!phonePagedQuery.action这个后台方法中已经有了这两个参数 所以通过上面的方法在加载数据源的时候 会在url后面附加上&card ="..‘’参数
me.pigFileStore = Ext.create("Ext.data.Store", {id : 'pigFileStore',
fields : ['id','feedNumber','pigpenNumber','card','entrytime','state'],
pageSize:10,
proxy : new Ext.data.proxy.Ajax({
actionMethods : {
read : 'POST'
},
//url : totalPath + '/mobile/mobilePigPen!phonePagedQuery.action',
url:'http://192.168.10.88:8080/pigFarmTrace/mobile/mobilePigFile!phonePagedQuery.action',
reader : {
type : 'json',
rootProperty : 'data',
totalProperty : 'totalCount'
},
extraParams: {
card: ''
},
autoLoad : false
})
});
相关文章推荐
- url 传参时包含&或者#号时当成参数解析的问题
- sencha-touch如何修改url中的参数
- 在传参时,url参数中包含+、空格、=、%、&、#等特殊符号的处理
- 使用Ext.net或者ExtJS时,如何在调用Grid.save()或者Store.save()传递更多的参数到后台
- URL传参小用法&获取url中的参数
- jsp的url后跟中文参数传参出现乱码
- AJAX传参,JS获取当前URL参数(超级实用)
- jsp中url传参中文参数在字符集转换后仍然有部分字符为问号的情况解决。
- nginx根据访问的url参数或者是请求 头部做判断转发
- Sencha Touch 2 官方文档翻译之 Using Store & Using Proxy(使用数据存储和代理)
- 在传参时,url参数中包含+、空格、=、%、&、#等特殊符号的处理
- Sencha Touch 2: 'specified Store cannot be found'
- Sencha touch Panel之间的跳转(如不使用TabPanel或者Carousel控件而产生跳转的动画效果)
- 出现浏览器请求禁止或者url参数缺失
- sencha-touch 获得指定数据源store方法
- sencha touch中用来格式化日期的字符串参数
- URL中文传参,后台接收参数乱码
- sencha touch xtemplate 动态参数
- URL传参:json参数传递转码
- sencha touch change model data of store but load function not work