dxq613 / bui

基于jQuery,兼容KISSY 的富客户端控件库
646 stars 359 forks source link

TreePicker不会自动读取预设值 #113

Closed safecat closed 10 years ago

safecat commented 10 years ago

写一个TreePicker,并将Store设为远程TreeStore,当valueField本身有值时,trigger中不会显示text,需要点击一下trigger才行。

<input type="text" id="select_category_id" readonly="readonly" />
<input id="select_category_id_hidden" type="hidden" name="category_id" value="3" />
var tree = new Tree.TreeList({
    store:new Data.TreeStore({
        url:'/product/category/index',
        autoLoad:true
    }),
    dirSelectable:false,
    showLine:true
});
picker = new TreePicker({
    trigger : '#select_category_id',  
    valueField : '#select_category_id_hidden',
    width : 150,
    children : [tree],
    autoRender : true
});

临时解决办法:

tree.get('store').on('load', function(){
    picker.show();
    picker.hide();
});
dxq613 commented 10 years ago

已解决