glee_java 2010-03-09 17:55
浏览 322
已采纳

如何使另一个Store重新加载我想要的结果集呢

//主信息
new Ext.grid.EditorGridPanel({
region:'center',
id:'ext-page',
title:'组信息',
clicksToEdit:1,
sm: new Ext.grid.CheckboxSelectionModel(),
store: this.store,//组信息数据源
tbar: ['-',{text:'新建',iconCls:'addCls',handler:this.addRecordRow}],
columns: [new Ext.grid.RowNumberer(),
new Ext.grid.CheckboxSelectionModel(),
{header:'小组名称' ,dataIndex:'sm',sortable:true,width:180
,editor: new Ext.form.TextField({allowBlank:false}) }],
listeners:{ afteredit: this.modifyField ,rowclick:this.tmpModel }
}),

//子信息

new Ext.grid.EditorGridPanel({
region: 'south',
height:350,
minHeight:250,
maxHeight:280,
autoScroll:true,
collapsible:true,
id:'ext-page-son',
title:'组员信息',
clicksToEdit:1,
sm: new Ext.grid.CheckboxSelectionModel(),
store: this.store_group,//组员信息数据源
tbar: ['-',{text:'新建',iconCls:'addCls',handler:this.addRecordRow}],
columns: [new Ext.grid.RowNumberer(),
new Ext.grid.CheckboxSelectionModel(),
{header:'小组名称' ,dataIndex:'sm',sortable:true,width:180
,editor: new Ext.form.TextField({allowBlank:false}) },
{header:'组员',dataIndex:'personname',sortable:true,width:120 }],
listeners:{ afteredit: this.modifyField }
})



点击组长后调用:tmpModel方法
tmpModel:function(){
var idsObj = Ext.getCmp('ext-page' ).getSelectionModel().getSelected();
alert(idsObj.get('id'));//获取组信息表的ID

}

请问,在这个方法里,我想把store_group的数据重新加载,
要加入idsObj.get('id')条件查询后的结果,再显示在ext-page-son的grid中,
应该怎么写呢???谢谢.
问题补充

store_group: new Ext.data.XmlStore({
autoDestroy: true,
url:"../gridRecordsActionByXML_group",
record: 'record',
idPath: 'id',
autoLoad: params:{ id:1 },
fields: [
{name:"id",mapping:'id',type:'int'},
{name:"sm",mapping:'sm'},

{name:"personname",mapping:'personname'},
{name:"personid",mapping:'personid'}
]

}),


autoLoad: params:{ id:1 },
默认时来会取ID:1的数据,
我想点击其他GRID时,获取ID,可是怎么动态更新params:{ id:<这个参数值> }呢???

新手上路,请各位高手多多指教吖>.<"
谢谢啦!
  • 写回答

1条回答 默认 最新

  • iteye_1059 2010-03-09 18:35
    关注

    [code="javascript"]
    store_group.load({
    params:{id:idValue}
    });
    [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 luckysheet
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误