1

スタイルに .css ファイルを使用しています。私のビュー ページには 2 つのリスト ビューがあり、2 つのリスト ビューに 2 つの異なる色が必要です。剣道UIでそれを行うにはどうすればよいですか

よろしく、

スリ

4

1 に答える 1

2

CSS 定義の前に listviewを付けidて、一方と他方を区別します。

ListViews の HTML が与えられた場合:

<div id="ListView1"></div>
<div id="ListView2"></div>

そして JavaScript:

$("#ListView1").kendoListView({
    dataSource: sharedDataSource,
    selectable: true,
    template: "<li>${title} ${year}</li>"
});
$("#ListView2").kendoListView({
    dataSource: sharedDataSource,
    selectable: true,
    template: "<li>${title} ${year}</li>"
});

CSS 定義は次のようになります。

#ListView1 .k-state-selected {
    background: red;
}
#ListView2 .k-state-selected {
    background: blue;
}
于 2012-11-26T09:53:59.653 に答える