Setting a grid collection

edited May 2014 in Enyo 2.4
Is there away to set a grid collection dynamically after an ajax call ?
.....
    create: function () {
        console.log("Create function called for ItemsGridview..."); 
        this.inherited(arguments); 
        this.onFetchItemList();
    },  
    onFetchItemList: function(){
        var prof = this.userProfile;
        var changedSetRef = this.changedSet;
         obj.getBrowse(prof,function onBrowseCallback(list){
            ameba_lastListViewed = [];
            ameba_lastListViewed = list;
            changedSetRef(list);
        });
    },
    changedSet : function(list){
        console.log("Calling meth");
        this.shows = new enyo.Collection(list); 
        //this.set("collection", this.shows);
    }
I get this method is undefined when I try to use the set function
this.shows = new enyo.Collection(list);   
this.$.gridList.set("collection" ,this.shows);
same error here as well :
this.$.gridList.collection.set('collection',this.shows);

....

Comments

  • Fixed:
    onFetchItemList: function(inSender, inEvent){
                var prof = this.userProfile;      
                var _gridList = this.$.gridList;
                var shows = new enyo.Collection();
                 obj.getBrowse(prof,function onBrowseCallback(list){
                    ameba_lastListViewed = [];
                    ameba_lastListViewed = list;
                    shows = new enyo.Collection(list); 
                      _gridList.set('collection',shows);
            }
Sign In or Register to comment.