2016-10-14 7 views
5

http://wix.github.io/angular-tree-controlから角度ツリーコントロールを実装しようとしましたが、セル全体をハイライト表示できません。私はtreecontrolが付属しているCSSを変更しようとしましたが、それでも私は全体のセルを強調表示できません。角度ツリーコントロールがセル全体をハイライト表示しない

現在及び期待される結果はここにある:

enter image description here

treecontrol { 
    font-family: Verdana, Helvetica, Arial, sans-serif; 
    font-size:13px; 
    color: #555; 
    text-decoration: none; 
} 
treecontrol ul { 
    margin: 0; 
    padding: 0; 
    list-style: none; 
    border: none; 
    overflow: hidden; 
} 
treecontrol li { 
    position: relative; 
    padding: 0 0 0 20px; 
    line-height: 20px; 
    ul { 
     padding-left: 16px; 
    } 
    .tree-label { 
     cursor: pointer; 
     display: inline; 
     &:focus { 
     outline: none; 
     } 
     &:hover { 
     outline: none; 
     background-color: yellow; 
     } 
    } 
    .tree-selected { 
     background-color: yellow; 
    } 
    &.tree-expanded { 
     > div { 
     > .tree-icon-expand { 
      display: none; 
     } 
     > .tree-icon-collapse { 
      display: inline; 
     } 
     } 
    } 
} 

treecontrol li.tree-expanded i.tree-leaf-head, treecontrol li.tree-collapsed i.tree-leaf-head {display:none;} 
treecontrol li.tree-expanded i.tree-branch-head, treecontrol li.tree-collapsed i.tree-branch-head {display:inline;} 
treecontrol li.tree-leaf i.tree-branch-head {display:none;} 
treecontrol li.tree-leaf i.tree-leaf-head {display:inline;} 

treecontrol li i.tree-branch-head { 
    cursor: pointer; 
} 

treecontrol li.tree-expanded i.tree-branch-head { 
    padding: 1px 10px; 
    background: url("../images/node-opened-light.png") no-repeat; 
} 

treecontrol li.tree-collapsed i.tree-branch-head { 
    padding: 1px 10px; 
    background: url("../images/node-closed-light.png") no-repeat; 
} 

treecontrol li.tree-leaf i.tree-leaf-head { 
    padding: 1px 10px; 
    width: 16px; height: 16px; 
    background: none no-repeat; 
} 
+3

CSSが – Ankh

+0

卿に関連するいくつかのHTMLは、上記で述べたように、私はちょうど、角ツリーコントロールを実装参照することが有用であろう。このリンクでは、HTMLはちょうど {{node.label}} iPhoneJavaDev

+2

フィドルを作成できますか? –

答えて

4

あなたがリンクされ、同じページの例を持って

custom css classes

あなたのjavascriptのは次のようになり

function CustomCss($scope) { 
    $scope.treedata=createSubTree(3, 4, ""); 
    $scope.opts = { 
     injectClasses: { 
      "liSelected": "c-liSelected", 
     } 
    }; 
} 

そして、あなたのCSS

.c-liSelected {background-color: yellow} 
+0

に変更しようとすると、左側に背景色が表示され、ノードの子の数に応じて伸びます。私はノード自体にバックグラウンドを維持する方法を考えていました。 – iPhoneJavaDev

関連する問題