views:

38

answers:

1

There's a button in Flash which looks something like a jQuery SplitButton. The Flash button consists of two parts, the text and the icon.

  [text portion] [v]

I have used it to display string search operators for the user: equals, starts with, ends with, contains. In Flash, when the icon is clicked, the text-area drops down a list of choices; it would look like this:

  [            ] [v]
     equals
     starts with
     ends with
     contains

And when the user makes a choice from the list, the choice is displayed in the text area of the button and the list rolls up.

   [ starts with ] [v]

I'm trying to convert my Flash app and am hoping to come up with a counterpart to this functionality. For space considerations on the form, a radio-button-group would be less than ideal. That's the major virtue of this Flash button -- it's very economical in its use of screen real-estate.

Thanks for any answers/suggestions.

A: 

You mention the jQuery UI SplitButton but you don't say why it's not suitable:

http://jqueryui.com/demos/button/#splitbutton

Surely you could just dynamically set the button text to the selection? An example of this would be the theme picker on the jQuery UI site.

colinramsay
@colinramsay: Thanks for taking the time to reply. I have been reading the SplitButton docs and cannot see whether this button type allows dropping down a list of possible selections when the icon is clicked. Does it? It may very well be suitable if it can do that. I would prefer not to use the approach where I create a div of LI items and position the DIV beneath the button and take responsibility in my own code for rolling the list down and rolling it up and resizing it -- though jQuery would probably make that not too hard to do.
Tim