Results 1 to 2 of 2

Thread: DataView's 'singleSelect' not working

  1. #1
    Sencha User
    Join Date
    Dec 2010

    Default DataView's 'singleSelect' not working

    Hello everyone,
    I am trying to enable selection of the data in the dataview just like grid but it is not working for me. I am not sure what I am doing wrong. Everything seems to be fine. Here is the code

    var tpl4 = new Ext.XTemplate (                  
                                                 '<tpl for=".">',
                                                  '<tpl if="values._post_id !=values._topic_first_post_id">',
                                                        '<div class="post-wrap">', 
                                                           '<div id="post-body">',
                                                                  '<span id="post-body-date">{_post_datetime:date("M j, Y")}<span style="color: #b90000; font-size: 11px;"> at</span> {_post_datetime:date(" H:i")}</span><span id = "post-content"> - {_post_content}</span><br>',
                                                                  '<span style="font-size: 11px; color: #777777;">Posted by: <span style="color: #0085cf;">{_user}</span></span><br>',    
                                                           '<div id="post-separator"></div>',
                                                        xtype: 'dataview',                        
                                                        id: 'postView',    
                                                        overClass : 'post-over',
                                                        singleSelect: true,
                                                        cls: 'post-view-class',
                                                        tpl: tpl4,
                                                        loadingText: 'Loading Posts...',
                                                        emptyText: '<span style="padding-left: 10px; font-size: 15px; ">No update for this event yet!</span>',
                                                        store: new{ 
                                                            fields : [         
                                                                      { name : '_post_content', mapping : '_post_content' },
                                                                      {name : '_topic_id',mapping:'_topic_id'},
                                                                      {name: '_user_picture', mapping: '_user_picture'},
                                                                      { name : '_user', mapping : '_user' },
                                                                      { name : '_post_datetime', mapping : '_post_datetime', type: 'date', dateFormat: 'Y-m-d H:i:s' },
                                                                      {name : '_post_id',mapping:'_post_id'},
                                                                      {name: '_topic_first_post_id',mapping:'_topic_first_post_id'}
                                                            url: 'index.php',
                                                            totalProperty : 'totalCount',
                                                            root : 'post',
                                                            autoLoad : true,
                                                            remoteSort : true,
                                                            id: 'post_store',
                                                            baseParams: {
                                                              cmd: 'get_post_details',
                                                        itemSelector: ''
    I have specified an 'overClass' and that works fine. But after clicking on the item, it doesnt show if its selected. I have also tried specifying selectedClass and that doesnt work either. Any help would be appreciated.


  2. #2
    Sencha User
    Join Date
    Dec 2010


    The problem is resolved. I added selectedClass configuration option and it works now. The default selection class (x-view-selected) of dataview doesn't event exist.

Similar Threads

  1. [OPEN] [FIXED-580] List multiSelect and allowDeselect (singleSelect) not working
    By konki_vienna in forum Sencha Touch 1.x: Bugs
    Replies: 6
    Last Post: 5 Sep 2011, 12:50 PM
  2. Dataview and multiselect not working?
    By miroperez in forum Sencha Touch 1.x: Discussion
    Replies: 6
    Last Post: 4 Sep 2011, 8:43 AM
  3. Dataview Selection Problem in singleSelect: true
    By emredagli in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 30 Jun 2009, 1:00 AM
  4. Dataview not working
    By cabster in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 25 May 2008, 2:06 PM

Tags for this Thread

Posting Permissions

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