2016-09-01 9 views
0

私はEnyoアプリでアイテムのリピーターを持っています。現在のセットアップでは、リピーターアイテムはタップされたことを示すトランジションまたはビジュアルキューを表示しません。リピーターアイテムの背景色をワンタッチでスタイルするには?

私が試したのは、リピーターのontapイベントから渡されたリピーターアイテムのクラスを設定することでした。

しかし、開発ツールにステッププロパティaddClassが定義されていないことを私に伝えます:

IncidentTickets.js:653 Uncaught TypeError: Cannot read property 'addClass' of undefined 

質問:

どのようにあなたがEnyoリピーターアイテムの背景色ONTAPのスタイルを設定することができますか?

.tapped { 
    background: #0CA281; 
} 

ザ・がONTAPイベントに渡されるリピータ項目にCSSクラスを追加しようとしました::

は基本的に私は緑にCSSスタイルの背景色を設定

tapPopupBundle: function(inSender, inEvent) { 

    var item = this.$.repeaterBundle.itemAtIndex(inEvent.index); 
    this.item.addClass('tapped'); 


}, 

そして、これはありますリピータの種類の定義:

{kind: "Scroller", name: "scrollerBundle", touch: true, horizontal:"hidden", showing: false, style: "height: 70%", components: [ 
       {content:"All Apps", style: "font-size: 12px; font-weight: bold; margin-left: 20px; text-decoration:underline;",ontap: 'clearFilters'}, 
       {kind: "Repeater", name: "repeaterBundle", count: 0, onSetupItem: "setupBundle", ontap: "tapPopupBundle", components: [ 
        {tag: "br"}, 
        { kind: "FittableColumns", components: [ 
         {name: "repBundle", style: "font-size: 12px; font-weight: bold; margin-left: 20px;"} 
        ]} 
       ]}, 
      ]}, 

答えて

0

渡された項目IDと呼び出しg appLlyStyleはこのケースで動作しました:

item.$.repAppName.applyStyle("background-color", 'rgb(12,162,129)');