Announcement

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

    How to make Hover/Prompt text selectable, so that I can copy the hovering tooltip

    I'm using window.footer.setPrompt("prompt text") to display a tooltip when hovering on the window footer.

    Is there a way that I can make the hover pop up box stay focused so that I can copy the text in the pop up box. Currently, the pop up box will be automatically disappeared when the mouse cursor goes out of the window footer area.

    Thanks

    #2
    The "prompt" functionality is just an ordinary browser tooltip, which is not extensible in the way you hope.

    You can use Canvas-level hover APIs, such as addHoverHandler(), to get basic hover events which would allow you to create your own hover widget. Then you could implement some means of dismissal for the hover which would allow it to be interacted with instead of disappearing immediately.

    Comment


      #3
      Originally posted by Isomorphic View Post
      The "prompt" functionality is just an ordinary browser tooltip, which is not extensible in the way you hope.

      You can use Canvas-level hover APIs, such as addHoverHandler(), to get basic hover events which would allow you to create your own hover widget. Then you could implement some means of dismissal for the hover which would allow it to be interacted with instead of disappearing immediately.
      I checked with Canvas API, it does not have addHoverHandler() function.

      If I understand the above suggestion, I have following definition:
      Code:
      isc.Window.create({
          ID: "myWindow",
          showFooter: true,
          showStatusBar: true,
          footerProperties: {
              handleHover: function() {
                  return isc.HTMLFlow.create({
                      contents: "test"
                  });
              }
          }
      })
      If I want to apply hover on this window footer widget, and update hover text, except for updateHover() method I should use, what else I should take care of?

      Code:
      myWindow.footer.updateHover("new hover text");
      The hover pop up box does not show in this case.

      Could you please give me more hints. Thanks for your help.

      Comment


        #4
        Sorry, addHoverHandler() is the SmartGWT method name, handleHover (which your code sample now uses) is the correct method to use in SmartClient.

        You are showing your own HTMLFlow widget, so updateHover() does not apply. This would update the hover text if you were using the built-in hover widget.

        You need to instead keep a reference to the HTMLFlow widget you've created, so you can later call setContents() on it to modify it's content.

        And of course, you need to decide on an approach for when/how the user dismisses this custom hover, and implement that.

        Comment

        Working...
        X