那麼,如何創建多選?extJS如何創建多選?
我在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
,只是白色的屏幕,當我刪除此代碼,萬物完美..跆拳道?我也想多選!
下載Firefox,來自getfirebug.com安裝Firebug擴展,然後用Firebug的運行代碼,打開和報到錯誤信息。 – JamesHalsall 2011-05-02 11:20:09
沒有錯誤螢火蟲建立 – waucherererpo 2011-05-02 11:27:01
如果正在顯示_nothing_,則必須發生錯誤,如果頁面上有文本,那麼它可能只是一個CSS問題 – JamesHalsall 2011-05-02 11:59:24