I want to display a label, text or button that is a clickable hyperlink to open a specific web page. What type of control should I use and how do I get the hyperlink to function? I have tried {view:“button”, id:“my_button”, value:phoneLink, type:“form”, inputWidth:100} where phoneLink is a variable containing my anchor tag.
You can use either of these controls, but in different ways:
- with label and template you can use A tag inside as they take pure HTML;
- with button you’ll need to specify a click handler that will open the link programmatically.
I got it working with the button code you gave me. Thank you for your help.
I also have a question related to this. I use in a template, the template is in a list. The list containing the tag is bound to a onItemClick event.
when I clicked the hyperlink, the list also receives the click event, how do I prevent this. Also, the is supposed to call a function, but sometimes I am confused with the scope. It seems the href=“javascript:function()” is not visible in current scope. I think I need some clarification.
thanks,
Cliff
Hi, @ymlan
onItemClick
will occur in any case, as this handler tracks any click on a list item. Instead, you can use onClick
for a particular class:
http://webix.com/snippet/a63aeaed
But can you share a snippet that will show the problem?
thank you very much, your hint solved my issue.
Cliff