Gridview with image and text

31 views
Skip to first unread message

Gargi Das

unread,
Sep 25, 2013, 5:06:00 AM9/25/13
to themp...@googlegroups.com
Hi,

I am tetsing all ui components of M-Project and there was need where i wanted to make a simple GridView which contains an image and a text and i can click on the image to navigate to something else !!

Is there any way i can do that with M Project ??

Regards,
Gargi

IT Forever

unread,
Sep 26, 2013, 4:57:25 PM9/26/13
to themp...@googlegroups.com
Hello Gargi,
What you could do is make an GridView with two LabelView's inside it. And then you could add CSS to one LabelView to add the image and using the LabelView property hyperlinkTarget you could add the link.

Hope this helped you. :)

hano

unread,
Sep 30, 2013, 5:11:08 AM9/30/13
to themp...@googlegroups.com
Hey,
do you want to navigate to a link or do you want to call a controller function?
Calling a Controller would work like this:
image: M.ImageView.design({

            value: 'theme/images/image.png',

events:{
tap:{
target: this,
action: function(){
console.log('hello');
}
}
}

        }),

You could also just change 'this' with 'MyApp.MyController' and the function with a string of the function name inside of the controller.

best regards
marco

Gargi Das

unread,
Oct 2, 2013, 11:49:25 PM10/2/13
to themp...@googlegroups.com
Thanks a lot all for reply !!

I solved this issues sometime back with use of DashBoardView ui component, but i think the suggestion given by IT forever is also nice i will use that too !!

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