[ 3 posts ]

Adrian

  • Username: Cyph3r
  • Joined: Wed Apr 18, 2012 9:06 am
  • Posts: 2
  • Offline
  • Profile

Adding HTML content to button on Y.Panel

Post Posted: Wed Apr 18, 2012 9:12 am
+0-
Hi, I would like to add some specific HTML inside a Button that I add to a Y.Panel widget. But I don't know how can I do that.
I tried using the label but it escapes all the content.

For example this is one of my buttons:

{
label : this.getInnerButton("Accept"),
action :
config.dialogActions.onAccept ?
config.dialogActions.onAccept.bind(this) :
function(e) {
e.preventDefault();
},
section : Y.WidgetStdMod.FOOTER,
classNames : ''
}

I would like to add a <span><b>MY LABEL</b></span>

Thanks

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile

Re: Adding HTML content to button on Y.Panel

Post Posted: Wed Apr 18, 2012 10:46 am
+0-
You can use the `yui3-button-label` CSS class to "tag" the element you want to hold the button's label text.

Here's an example of doing within a Panel:
http://jsfiddle.net/ericf/aXkNs/3/

Adrian

  • Username: Cyph3r
  • Joined: Wed Apr 18, 2012 9:06 am
  • Posts: 2
  • Offline
  • Profile

Re: Adding HTML content to button on Y.Panel

Post Posted: Wed Apr 18, 2012 11:21 am
+0-
Ok . But then can I change that class ? I would like to have my self defined CSS class instead of the one that provides YUI in that element.

Another question that I have is there is a way to change the mask element without using a Y.Node ? I would like to replace the css class / style that provides YUI.

Thanks !
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum