Ext.Ajax.request({
url : basePath + '/ZtcServlet?action=ztcBwglGc',
params : {
ztc_id : ztc_id,
zkbj : Ext.getCmp('zhong').getValue(),// 重
czcx : Ext.getCmp('cx').getValue(),// 车型
czdm : Ext.getCmp('cz').getValue(),// 车种
gcyz : Ext.getCmp('you').getValue(),// 油
dydzlm : Ext.getCmp('lm').getValue(),// 略码
djdm : Ext.getCmp('comboDj').getValue(),// 到局
dfjdm : Ext.getCmp('fj').getValue(),// 分局
fxh : Ext.getCmp('fx').getValue(),// 方向
js : Ext.getCmp('comboJs').getRawValue(),// 记事
qtbz : Ext.getCmp('comboGs').getRawValue().substring(0,
1), // 公司
bqbj : Ext.getCmp('comboLx').getRawValue().substring(0,
1), // 车辆属性
cs : Ext.getCmp('cs').getValue(),
// 车数
// 类型 原radio 4个选项
rksj : (new Date()).format('Y-m-d H:i:s')
// rksj : (new Date()).format('Ymd')
// rksj : '2009-11-01' }, method : 'POST',
success : function(response) {
ajaxMask.hide();
var result = Ext.decode(response.responseText);
if (result.success) {
// alert(result.msgText);
gridBwgl.getStore().reload({});
gridBwglRight.getStore().reload({});
storeXzQb.reload();
// var c = gridBwgl.getView().scroller.dom;
// alert(c)
// c.scrollTop = c.scrollTop + 30;
// alert(c)
// alert(c.scrollTop)
gridBwgl.getView().scroller.dom;
gridBwgl.getView().focusRow(30);
} else {
alert(result.msgText);
}
},
failure : function() {
ajaxMask.hide();
Ext.Msg.alert('提示', '数据操作失败');
}
});
}代码如上所示 如何写如果执行成功,则滚动条到最后。

解决方案 »

  1.   

    gridBwgl.getView().focusRow(gridBwgl.getStore().getCount()-1);我用这个可以找到最后一行,为什么 一转眼又跑到第一行了啊
      

  2.   

    gridBwgl.getStore().reload({});
    gridBwglRight.getStore().reload({});
    storeXzQb.reload();我刚才看了一下,是有刷新  执行了上面的3个reload请问如何实现 先执行
    gridBwgl.getStore().reload({});
    gridBwglRight.getStore().reload({});
    storeXzQb.reload();然后再执行
    gridBwgl.getView().focusRow(gridBwgl.getStore().getCount()-1);这个呢
      

  3.   

    gridBwgl.getStore().reload({});
    gridBwglRight.getStore().reload({});
    storeXzQb.reload(); gridBwgl.getView().focusRow(gridBwgl.getStore()
    .getCount()
    - 1);我把这4个同步写了,执行了滚动条到最后 然后一刷新 又回去了。