bootstrap-treeview 加载默认选择第一个节点

    configAppTree: function (oArrayData){
		$('#appTree').treeview({
          color: "#545454",
          expandIcon: 'glyphicon glyphicon-chevron-right',
          collapseIcon: 'glyphicon glyphicon-chevron-down',
          nodeIcon: 'glyphicon glyphicon-bookmark',
          data: oArrayData,
          onNodeSelected: function (event, data) {
              oGrid.setAppGridData(data);
              oGrid.getTreeSelections = data;
            }
        });
        if (oArrayData !=undefined && oArrayData.length > 0) {
          var nodeId = 0;
            $('#appTree').treeview('selectNode', [nodeId, { silent: true }]);
            oGrid.setAppGridData(oArrayData[0]);
            oGrid.getTreeSelections = oArrayData[0];
          }
        },

 

posted @ 2019-03-25 17:33  King、Wang  阅读(4707)  评论(0编辑  收藏  举报