new LinkButton(label)
Parameters:
| Name | Type | Description |
|---|---|---|
label |
string | Rótulo do LinkButton. |
Example
import {LinkButton,Badge,ELinkTarget} from "mvcomponents/button";
import {EBasicColorStatus} from "mvcomponents/component";
let linkButton:LinkButton = new LinkButton("Label Inicial")
.setTarget(ELinkTarget.BLANK)
.setURL("http://www.mv.com.br");
.setIcon("mv-basico-dados_demograficos")
.setColor(EBasicColorStatus.PRIMARY)
.setLabel("Teste!")
.setTooltip("Tooltip do LinkButton");
let danger:Badge = new Badge("link teste!").setColor(EBasicColorStatus.DANGER);
linkButton.setBadge(danger);
Extends
Methods
-
addEvent(type, handler)
-
Adiciona um novo listener ao componente
Parameters:
Name Type Description typeEMouseEvent | EKeyboardEvent handlerfunction - Inherited From:
-
getTarget()
-
Retorna o target do link.
ELinkTarget é um enum para os targets: BLANK,PARENT,SELF,TOP. Verificar o site para entender como irá abrir o link: https://www.w3.org/TR/html4/types.html#type-frame-target
Returns:
- Type
- ELinkTarget
Example
let linkButton1:LinkButton = new LinkButton("Label LinkButton") .setTarget(ELinkTarget.BLANK); let linkButton2:LinkButton = new LinkButton("Label LinkButton") .setTarget(ELinkTarget.SELF); let eLinkTarget:ELinkTarget = linkButton.getTarget(); -
getURL()
-
Altera a url do link.
Returns:
- Type
- string
Example
let linkButton:LinkButton = new LinkButton("Label LinkButton") .setURL("http://www.mv.com.br"); let url:string = linkButton.getURL(); //Retorna "http://www.mv.com.br" -
removeAllEvents( [callback])
-
Remove todos os listeners de um elemento
Parameters:
Name Type Argument Description callbackfunction <optional>
- Inherited From:
-
removeEvent(type, handler)
-
Remove um listener do objeto
Parameters:
Name Type Description typeEMouseEvent | EKeyboardEvent handlerfunction - Inherited From:
-
setBadge(badge)
-
Altera o Badge do LinkButton.
Parameters:
Name Type Description badgeBadge Badge do LinkButton
Returns:
- Type
- LinkButton
Example
let badge:Badge = new Badge('label'); let linkButton:LinkButton = new LinkButton(); linkButton.setBadge(badge); -
setColor(color)
-
Informa a cor do botão.
Obs.: Utiliza o EBasicColorStatus do grupo 'mvcomponents/component' para definir a cor do LinkButton.
Parameters:
Name Type Description colorEBasicColorStatus EBasicColorStatus do grupo 'mvcomponents/component' para definir a cor do LinkButton.
Returns:
- Type
- LinkButton
Example
let linkButton1:LinkButton = new LinkButton("DANGER").setColor(EBasicColorStatus.DANGER); let linkButton2:LinkButton = new LinkButton("SUCCESS").setColor(EBasicColorStatus.SUCCESS); let linkButton3:LinkButton = new LinkButton("INFO").setColor(EBasicColorStatus.INFO); let linkButton4:LinkButton = new LinkButton("PRIMARY").setColor(EBasicColorStatus.PRIMARY); let linkButton5:LinkButton = new LinkButton("WARNING").setColor(EBasicColorStatus.WARNING); -
setIcon(psrc)
-
Altera o ícone que será exibido pelo LinkButton.
Parameters:
Name Type Description psrcstring icone que será exibido
Returns:
- Type
- LinkButton
Example
let linkButton:LinkButton = new LinkButton("Label LinkButton") .setIcon("mv-basico-adicionar"); -
setLabel(label)
-
Atribui ou substitui o rótulo do LinkButton
Parameters:
Name Type Description labelstring Texto que deve substituir a label do botão.
Returns:
- Type
- LinkButton
Example
let linkButton:LinkButton = new LinkButton("Label Original LinkButton"); linkButton.setLabel("Label modificado"); -
setTarget(target)
-
Altera o target do link.
ELinkTarget é um enum para os targets: BLANK,PARENT,SELF,TOP. Verificar o site para entender como irá abrir o link: https://www.w3.org/TR/html4/types.html#type-frame-target
Parameters:
Name Type Description targetELinkTarget Enum que indica como o link será aberto.
Returns:
- Type
- LinkButton
Example
let linkButton:LinkButton = new LinkButton("Label LinkButton") .setTarget(ELinkTarget.blank); -
setTooltip(tooltip)
-
Atribui ou substitui o Tooltip do LinkButton
Parameters:
Name Type Description tooltipstring Texto que deve ser exibido no Tooltip.
Returns:
- Type
- LinkButton
Example
let linkButton:LinkButton = new LinkButton("Label LinkButton"); linkButton.setTooltip('Tooltip do LinkButton'); -
setURL(url)
-
Altera a url do LinkButton.
Parameters:
Name Type Description urlstring Caminho que será aberto ao clicar no LinkButton.
Returns:
- Type
- LinkButton
Example
let linkButton:LinkButton = new LinkButton("Label LinkButton") .setURL("http://www.mv.com.br");
