Results 1 to 3 of 3
  1.    #1  
    Hi everyone. I hope to get some help with my problem.
    In my application I have a FilterList with thousands of items in it. The items come from an array (data[] - declared globally in StageAssistant) which is populated from database...When the scene is pushed and the list is populated, I can click on any item which takes me to a new scene (I pass the name of the clicked item to the next scene). However, after I scroll down the list and then try to tap on any item, the ListTap doesn't work and I cannot figure out why??? Below is my code. Any help is greatly appreciated. Thank you.

    Code:
    ListAssistant.prototype.setup = function() { 
      
    var attributes =
    {
    itemTemplate: 'list/itemTemplate',
    swipeToDelete: false,
    reorderable: false,
    filterFunction: this.list.bind(this),
    delay: 1000, //1 second delay before filter string is used
    disabledProperty: 'disabled'
    };
    this.model = {
    disabled: false
    };
    
    this.controller.setupWidget('filterlist', attributes, this.model);
    this.controller.listen('filterlist', Mojo.Event.listTap, this.tapped.bindAsEventListener(this));
    this.controller.listen('filterlist', Mojo.Event.filter, this.gotFilter.bind(this), true);
    }
    
    
    
    ListAssistant.prototype.tapped = function(event) {   
       var sName = myFilteredData[event.index].Name;      
       Mojo.Controller.stageController.pushScene('test', sName);
    }
    
    
    
    
    ListAssistant.prototype.list = function(filterString, listWidget, offset, count){
    var subset = [];
    var totalSubsetSize = 0;
    
    //loop through the original data set & get the subset of items that have the filter string 
    var i = 0;
    while (i < data.length) {
    
    if (data[i].Title.toUpperCase().startsWith(filterString.toUpperCase())) {
       
    if (subset.length < count && totalSubsetSize >= offset) {
       subset.push(data[i]);
    }   
       totalSubsetSize++;
    }
    i++;
    }
    
    myFilteredData = subset;
    
    //update the items in the list with the subset
    listWidget.mojo.noticeUpdatedItems(offset, subset);
    
    //set the list's length & count if we're not repeating the same filter string from an earlier pass
    if (this.filter !== filterString) {
    listWidget.mojo.setLength(totalSubsetSize);
    listWidget.mojo.setCount(totalSubsetSize);
    }
    this.filter = filterString;
    }
  2. #2  
    i'm having the same issue.
    i tried this for my tap Handler. It works for the first 10 or so items in the list, but then anything after that it breaks on

    Code:
    MainAssistant.prototype.listItemTapped = function(event){
    	Mojo.Controller.stageController.pushScene('rep-info', this.filteredList[event.index]);
    }
  3. #3  
    here's the easy way to handle taps on a list - works every time (in a filterlist or not)

    Code:
    MainAssistant.prototype.listItemTapped = function(event){
    	Mojo.Controller.stageController.pushScene('someScene', event.item);
    }

Posting Permissions