Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Split menu button?

    Does Smart GWT support the concept of a split menu button? Specifically, a button with text/icon and a drop-down arrow that when its text is clicked fires a click handler, but when the drop-down arrow is clicked shows a menu? A use case would be a Search button that has a drop-down menu to configure exactly what is searched when it's clicked. See the attached image for what it looks like in ExtJS.
    Attached Files

    #2
    See the docs for IconButton and IconMenuButton, and probably the docs for RibbonBar also.

    Comment


      #3
      Those all refer to icons -- will they work if no icon is shown, like in the screenshot I attached? Didn't see anything in the showcase like that.

      Comment


        #4
        If you read the documentation we directed you to, you'll see such attributes as showIcon

        Comment


          #5
          Thanks, though a bit disappointed by your snarkyness. I'll write some code to give it a try and will reply back with my results, in case anyone else is interested in the possibility of this.

          Comment


            #6
            Got it working; see the attached image. Here's the code; I basically stripped out the ToolStripMenuButton class and the toolStrip.addToolStripMenuButton call and replaced it with IconMenuButton and addMember (a bit convoluted; I feel better about having to ask in the forums about this):

            Code:
            IconMenuButton testButton = new IconMenuButton("Test", menu);
            testButton.addClickHandler(new ClickHandler() {
            	@Override
            	public void onClick(ClickEvent event) {
            		SC.say("clicked");
            	}	
            });
            toolStrip.addMember(testButton);
            The UI definitely isn't as user-friendly as the ExtJS one though -- there's no bar separating the text from the drop-down arrow indicating two separate actions to the user, and the hover-over is a simple box line and not the normal gradient with rounded corners. A bit weird. Fortunately my users are all internal and I don't have to worry much about looks :p
            Attached Files

            Comment

            Working...
            X