1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    21
    Vote Rating
    1
    daftwolfie is on a distinguished road

      0  

    Default Unanswered: Iterate through a list which has an itemtap function

    Unanswered: Iterate through a list which has an itemtap function


    Hi all!,

    Been searching online for sources, but I have been unlucky. I currently have a list of items and I had given them an itemtap function. When any of the items on the list are clicked, they will display a map with a marker indicating the lat and long location of the item. However, right now, all the items are leading to the same lat and long. (Each item has a different lat and long)

    Here is my controller, which has the itemtap function for the list:

    Code:
    Ext.define('demo.controller.News',{
        extend:'Ext.app.Controller',
    
    
        config:{
            refs:{
                NewsContainer:'newscontainer'
    
    
            },
            control:{
                'newscontainer new list':{
                    itemtap:function(list, index, target, record){
                        var detailsView =Ext.create('demo.view.Mapo');
                        detailsView.setData(record.data);
                        this.getNewsContainer().push(detailsView);
    
    
                    }
                }
    
    
            }	
        }
    });
    I was wondering how to place a 'for' loop which would enable me to tap on an item and display a different marker on the map (Mapo.js). Any help would be greatly appreciated. Thank you!

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    148
    Answers
    12
    Vote Rating
    10
    pentool will become famous soon enough

      0  

    Default


    Not sure, but wonder if you might need to use
    Code:
    detailsView.setRecord(record);
    as opposed to
    Code:
    detailsView.setData(record.data);

Thread Participants: 1

Tags for this Thread