ListView render method

27 views
Skip to first unread message

Gargi Das

unread,
Dec 11, 2013, 12:56:49 AM12/11/13
to themp...@googlegroups.com
Hi,

I am working with M Project 1.4 version and was making couple of custom views. In one of custom views i am using M.ListView and i want the html representation of the ListView but its not happening check the two methods below:

     renderListItemView:function(parent, logCurveName) {
        var listItem = M.ListItemView.design({
            childViews:'label',
            parentView:parent,
            label: M.LabelView.design({
                value:logCurveName
            }),
            events:{
                tap:{
                    target: this,
                    action:'listItemClicked'
                }
            }
        });
        return listItem;
    },

    renderListView:function(dataList,index) {
        var listView = M.ListView.design({})

        for(var i = 0; i <dataList.length;i++) {
           var element = dataList[i].name
           var listItemView = this.renderListItemView(listView,element);
           listView.addItem(listItemView.render());
           listItemView.registerEvents();
        }
        this.log(listView.render())
        return listView.render();
    },


Here in the second method listview.render method always return a blank <ul></ul> representation , i always call listview.additem !!

Can anybody help me to correctly achieve this !!

Regards,
Gargi
Reply all
Reply to author
Forward
0 new messages