[ 3 posts ]

Nes

  • Username: Nes
  • Joined: Tue Jun 05, 2012 12:17 pm
  • Posts: 2
  • Offline
  • Profile

Uploader, can I change the style of the Select Files button?

Post Posted: Tue Jun 05, 2012 12:29 pm
+0-
Hi,

First time poster here.

I have been playing around with Uploader version 3.5.1.

The Select Files button shows a completely different font from the rest of my pages (I set the font at body level). Can I change the font that the widget uses?

I've also tried to use the selectFilesButton attribute to change the button used, but the documentation is not clear what the value of the attribute should be. I've tried a view different options, but every time I end up with a button that does not pop up the dialog.

Any tips appreciated. Ideally I would like to Select Files button to look exactly (also in size, margins etc) like my form submit buttons which are really just yui3-buttons:

<input type="submit" class="yui3-button" value="Submit"/>

Many thanks,
Nes

Allen Rabinovich

YUI Developer

  • YUI Developer
  • Offline
  • Profile

Re: Uploader, can I change the style of the Select Files but

Post Posted: Mon Jun 11, 2012 1:57 pm
+0-
Hi Nes,

The style of the "Select Files" button is determined by the static property on the Uploader, Uploader.SELECT_FILES_BUTTON -- that's the HTML string, whose default value is
Code:
<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>
.

The {selectButtonLabel} token gets replaced by the default valueFn of the selectFilesButton attribute, which requires an instance of Node. You can either modify the static template before rendering the Uploader (e.g. Y.Uploader.SELECT_FILES_BUTTON = "some html string, possibly with the {selectButtonlabel} token";), or override the value of the selectFilesButton attribute altogether with a completely different node instance. For example, when creating a new instance of Uploader, you could do:
Code:
var myuploader = new Y.Uploader({multipleFiles: true, .... /*other config attrs*/, selectFilesButton: Y.Node.create("<button class='yui3-button'>Choose Files</button>")});

Nes

  • Username: Nes
  • Joined: Tue Jun 05, 2012 12:17 pm
  • Posts: 2
  • Offline
  • Profile

Re: Uploader, can I change the style of the Select Files but

Post Posted: Mon Jun 18, 2012 5:21 am
+0-
Many thanks, that worked like a charm!
  [ 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