2017-06-02 25 views

答えて

1

あなたは動的にk-group-cell k-header要素にbutton要素を作成することができます。

var expandCollapseAll = document.createElement('button'); 
expandCollapseAll.innerHTML = ">"; 
var elementToAppend = document.getElementsByClassName("k-group-cell k-header"); 
elementToAppend[0].appendChild(expandCollapseAll); 
expandCollapseAll.onclick = toggleExpandCollapse; 

toggleExpandCollapse機能は、グリッド上のすべての.k-icon.k-collapse.k-icon.k-expand要素のclickイベントをトリガします。すべてを折りたたむに

$("#grid").find(".k-icon.k-collapse").trigger("click"); 

すべて展開する:

$("#grid").find(".k-icon.k-expand").trigger("click"); 

私はアクションで上記を実証するsample JSFiddleを作成しました。

注:ボタンのCSSは少しオフになっているが、これはあなたが:)

+0

うんを軌道に乗るために十分でなければなりません。できます!どうもありがとう :) – IceWhisper

関連する問題