Javascript 如何在ExtJS中滚动到表单末尾
我有一个具有自动滚动功能的表单。在向表单添加新项目时,如何滚动到表单底部Javascript 如何在ExtJS中滚动到表单末尾,javascript,extjs4,Javascript,Extjs4,我有一个具有自动滚动功能的表单。在向表单添加新项目时,如何滚动到表单底部 height: 200, autoScroll: true, 这是我的示例如果在表单末尾添加了字段,则以下解决方案可能会有所帮助: EXTJS 5和6 在表单config中: scrollable: true, 在按钮处理程序中: { xtype: 'button', itemId: 'addChildBtn', di
height: 200,
autoScroll: true,
这是我的示例如果在表单末尾添加了字段,则以下解决方案可能会有所帮助: EXTJS 5和6 在表单config中:
scrollable: true,
在按钮处理程序中:
{
xtype: 'button',
itemId: 'addChildBtn',
disabled: false,
text: 'Clone fieldset',
handler: function () {
// Clone field set
var set = Ext.getCmp('s1');
var s = set.cloneConfig();
form.add(s);
this.up('form').getScrollable().scrollTo(0, 9999);
}
}
{
xtype: 'button',
itemId: 'addChildBtn',
disabled: false,
text: 'Clone fieldset',
handler: function () {
// Clone field set
var set = Ext.getCmp('s1');
var s = set.cloneConfig();
form.add(s);
this.up('form').scrollBy(0, 9999, true);
}
}
ExtJS4
在按钮处理程序中:
{
xtype: 'button',
itemId: 'addChildBtn',
disabled: false,
text: 'Clone fieldset',
handler: function () {
// Clone field set
var set = Ext.getCmp('s1');
var s = set.cloneConfig();
form.add(s);
this.up('form').getScrollable().scrollTo(0, 9999);
}
}
{
xtype: 'button',
itemId: 'addChildBtn',
disabled: false,
text: 'Clone fieldset',
handler: function () {
// Clone field set
var set = Ext.getCmp('s1');
var s = set.cloneConfig();
form.add(s);
this.up('form').scrollBy(0, 9999, true);
}
}