那么,如何创建多选?
我在sencha.com上找到了这个教程:
var msForm = new Ext.form.FormPanel({
title: 'MultiSelect Test',
width:700,
bodyStyle: 'padding:10px;',
items:[{
xtype:"multiselect",
fieldLabel:"Multiselect<br />(Required)",
name:"multiselect",
dataFields:["code", "desc"],
valueField:"code",
displayField:"desc",
width:250,
height:200,
allowBlank:false,
data:[[123,"One Hundred Twenty Three"],
["1", "One"], ["2", "Two"], ["3", "Three"], ["4", "Four"], ["5", "Five"],
["6", "Six"], ["7", "Seven"], ["8", "Eight"], ["9", "Nine"]],
tbar:[{
text:"clear",
handler:function(){
msForm.getForm().findField("multiselect").reset();
}
}]
}],
buttons: [{
text: 'Save',
handler: function(){
if(msForm.getForm().isValid()){
Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+
msForm.getForm().getValues(true));
}
}
}]
});
当我粘贴它,并写入msForm,只是白色屏幕,当我删除此代码时,Everythings完美.. wtf?我也想要多选!!
答案 0 :(得分:1)
添加代码是不够的!您需要添加CSS和JS文件。你需要添加:
您还必须根据您的要求使用ItemSelector.js。这些文件位于: