如何在 Extjs 3.2 上使用卡片布局创建高级向导表单?
extjs 2.0 有一个 Ext.ux.wizard,我们可以为 extjs 创建类似于表单的向导,并在用户单击(例如)下一个按钮时轻松验证表单元素。请参阅此处的演示:http://www.siteartwork.de/wizardcomponent_demo 。在 extjs 3.2 上,有卡片布局可以帮助创建向导。请参阅演示: http://dev.sencha.com/deploy/dev/examples/layout-browser/layout-browser.html 。
代码:
/*
* ================ CardLayout config (Wizard) =======================
*/
var cardWizard = {
id:'card-wizard-panel',
title: 'Card Layout (Wizard)',
layout:'card',
activeItem: 0,
bodyStyle: 'padding:15px',
defaults: {border:false},
bbar: ['->', {
id: 'card-prev',
text: '« Previous',
handler: cardNav.createDelegate(this, [-1]),
disabled: true
},{
id: 'card-next',
text: 'Next »',
handler: cardNav.createDelegate(this, [1])
}],
items: [{
id: 'card-0',
html: '<h1>Welcome to the Demo Wizard!</h1><p>Step 1 of 3</p><p>Please click the "Next" button to continue...</p>'
},{
id: 'card-1',
html: '<p>Step 2 of 3</p><p>Almost there. Please click the "Next" button to continue...</p>'
},{
id: 'card-2',
html: '<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>'
}]
};
但是当我单击下一步时似乎没有验证,或者当我到达向导的最后一步时没有提交按钮。有人有关于更发达的向导的示例吗?
There was an Ext.ux.wizard for extjs 2.0 which we could create wizard like forms for extjs and easily validate form elements when user clicked (eg)next button.see demo here: http://www.siteartwork.de/wizardcomponent_demo . On extjs 3.2 there is card layout which helps creating wizards.see demo: http://dev.sencha.com/deploy/dev/examples/layout-browser/layout-browser.html .
Code:
/*
* ================ CardLayout config (Wizard) =======================
*/
var cardWizard = {
id:'card-wizard-panel',
title: 'Card Layout (Wizard)',
layout:'card',
activeItem: 0,
bodyStyle: 'padding:15px',
defaults: {border:false},
bbar: ['->', {
id: 'card-prev',
text: '« Previous',
handler: cardNav.createDelegate(this, [-1]),
disabled: true
},{
id: 'card-next',
text: 'Next »',
handler: cardNav.createDelegate(this, [1])
}],
items: [{
id: 'card-0',
html: '<h1>Welcome to the Demo Wizard!</h1><p>Step 1 of 3</p><p>Please click the "Next" button to continue...</p>'
},{
id: 'card-1',
html: '<p>Step 2 of 3</p><p>Almost there. Please click the "Next" button to continue...</p>'
},{
id: 'card-2',
html: '<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>'
}]
};
but there seems no validations when i click next or there is no submit button when i reach last step of wizard.does anybody have any examples on a more developed wizard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查此线程 - http://www.sencha .com/forum/showthread.php?121059-Making-a-Wizard&highlight=wizard
或者使用现成的扩展程序 - http://code.google.com/p/ext-ux -wiz/ (它似乎与 ExtJS 3.2 一起使用),它的论坛线程在这里 - http://www.sencha.com/forum/showthread.php?36627-2.1-Ext.ux .Wiz-a-wizard-component-for-Ext-JS/page25
Check this thread - http://www.sencha.com/forum/showthread.php?121059-Making-a-Wizard&highlight=wizard
Or use ready extension - http://code.google.com/p/ext-ux-wiz/ (it seems to be working with ExtJS 3.2), the forum thread for it is here - http://www.sencha.com/forum/showthread.php?36627-2.1-Ext.ux.Wiz-a-wizard-component-for-Ext-JS/page25