[英]Sencha Touch DataView and highlighting a row when selected
我在容器內有一個dataview列表,該列表在視圖內正確顯示項目。 但是,每當我單擊某個項目時,它都不會突出顯示。
我已將其添加到包含DataView列表的視圖中:
onItemTap: function (container, target, index, e) {
var me = this;
me.callParent(arguments); // WARNING: without this call, the row will not become selected
}
我已經讀到,如果我沒有以上內容,該項目將不會被選中。 我也可以看到此事件被觸發。 如果我通過Sencha Touch源代碼進行調試,則可以看到將x-item-selected的CSS類添加到了包裝列表項的DIV中,但是該行沒有突出顯示。 這在普通列表上很好用,所以我想念什么?
更新了CSS,似乎可以正常工作。
.x-dataview .x-data-item.x-item-selected
{
border-top-color: #006bb6;
background-image: -webkit-linear-gradient(top, #0398ff, #007ad0 3%, #005c9d);
color: white;
}
默認情況下,Sencha Touch Dataview不提供任何突出顯示。 向.x-item-pressed
或.x-item-selected
類添加背景或其他內容,您將獲得所需的效果。
如何在配置塊中設置selectedCls ?
請參閱以下鏈接以獲取詳細信息
http://docs.sencha.com/touch/2.2.1/#!/api/Ext.dataview.List-cfg-selectedCls
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.