<input id="test" name="test" class="mini-treeselect" url="../data/tree.txt" valueField="id" textField="text" parentField="PId" allowInput="true" virtualScroll="true"
onbeforenodeselect="onbeforenodeselect" expandOnLoad="0" showFolderCheckBox="true" valueFromSelect="true" popupWidth="200px" popupHeight="280px" showClose="true"
oncloseclick="onCloseClick"/>
js代碼
function onbeforenodeselect(e){
//禁止選中父節點
if(e.isLeaf==false)e.cancel=true;
}
function onCloseClick(e){
//清空下拉樹或下拉框
var obj=e.sender;
obj.setText("");
obj.setValue("");
}

mini-treeselect 設置下拉寬度:popupWidth="200px" ,設置下拉高度:popupHeight="250px",比如高度閾值為250,當設置為280,但是展示的效果還是設置的250,那么可以使用css樣式來改動了。
<style type="text/css">
.min-popup{
min-height:280px !important;
}
.min-panel{
min-height:280px !important;
}
</style>
allowInput:可以輸入,並模糊查詢。
virtualScroll:虛擬模式,適合於大數據顯示場合。意思就是如果數據量比較大,可以使用這個控件分批加載。
expandOnLoad:0 展開第一級節點
showFolderCheckBox:顯示父節點的checkbox
valueFromSelect:必須從選擇項中錄入
當使用 mini-treegrid時,id="datagrid1",需要注意會向后台有兩次請求,第一次不帶參數,第二次帶參。url可以設置為空。
解決方法:mini.parse();
var grid=mini.get("datagrid1");
var form=new mini.Form("form");
在search方法里使用
var o=form.getData();//可以獲取到form表單中表單數據,但是必須都要帶name。
grid.setAjaxOption({data:o});
grid.setUrl("") 后台url請求攔截地址,就是查詢按鈕。
當使用mini-datagrid時,請求后台可以使用:
grid.load(o,function(){
var tableRows=grid.getData().length;//獲取查詢的條數
if(tableRows<1){
mini.alert("沒有查詢到數據!");
}
mini.unmask();//隱藏遮罩
})
其余的可以參考http://www.miniui.com/docs/api/index.html#ui=treeselect
