Results 1 to 3 of 3

Thread: How to highlight Selected Item in an DataView of SenchaTouch2

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    25
    Answers
    1

    Default How to highlight Selected Item in an DataView of SenchaTouch2

    I have created the DataView using Senha Touch 2. This consists of Image with Text.
    Please see image i attached my issues is
    1) : When i select on particular image it should get highlighted.
    2) : In ExtJS4 we can do it by
    overItemCls : 'x-item-over',
    itemSelector : 'div.thumb-wrap'
    Please Explain me how can i do it in Sencha Touch2

    This is my code for DataView
    [{
    xtype : 'dataview'
    ,scrollable : false
    ,store : Ext.create('WitMSite.store.Func',{
    url : 'funcs.json'
    ,proxyType : 'ajax'
    ,model : 'WitMSite.model.Func'
    ,readerType : 'json'
    ,rootElem : 'root'
    ,autoLoad : true
    })
    ,inline : true
    ,pressedDelay : 0
    ,loadingText : 'Loading...'
    ,itemTpl : new Ext.XTemplate(
    '<tpl for=".">',
    '<div class="main-image-div">',
    '<div class="image-div"><img src="{img}" /></div>',
    '<div class="{name}"></div>',
    '</div>',
    '</tpl>'
    )
    ,listeners : {
    itemtap : function(record, index){
    }
    }
    }]
    Attached Images Attached Images

  2. #2
    Sencha Premium User
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    693
    Answers
    21

    Default

    you can style the selected css class to highlight it

    http://docs.sencha.com/touch/2-0/#!/...fg-selectedCls

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Location
    Ahmedabad, India
    Posts
    15
    Answers
    1

    Default

    Hi,

    you can override this css class

    Code:
    .x-item-selected {
         background: #000fff;
    }
    
    
    put background color in it. it will highlight your selected row as per given color.

    Thanks,
    Piyush Dholariya


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •