Announcement

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

    LinkItem in Grid

    Is it possible to put a LinkItem in a grid column?

    I'd like to be able to perform an action when a cell is clicked on. I would like it to be obvious that the user can click on the contents of the column, so I would prefer not to use the grid cell click listener.
    Is there is another solution other than a LinkItem?

    Thanks,
    Curtis

    #2
    Yes you can, see the example in the ShowCase. Of course you can set a cell formatter to set the styling of plain text any way you want and then use a cell click listener too.

    Comment


      #3
      LinkItem in Grid

      Thank you.

      Are you saying "Yes you can" add a LinkItem, or "Yes you can" do a cell link listener and styles?

      I have looked at the examples in the showcase. There's only about 100 different examples. I did not find one that uses a LinkItem.

      Under the "Data Types" item under the "Grid" item, there are 11 different types. None of which are LinkItems. There are two "Link" ones, but they follow actual HTML links. I would like a LinkItem so that I can control the action when it is clicked (not go to another web page).

      Could you please let me know which example in the showcase you are referring to.

      Thanks,
      Curtis

      Comment


        #4
        You can use regular html links without going to another page through JSNI.
        Code:
        public native void defineBridgeMethod() /*-{
            var foo = this;
            $wnd.doStuff = function(s) {
               foo.@package.Class::(Ljava/lang/String;)(s);
            }
        }-*/;
        and your link should be
        Code:
        <a href="javascript:window.doStuff(s);">click</a>

        Comment


          #5
          LinkItem in Grid

          mhulsman; that is a creative solution.
          Thanks.

          Comment


            #6
            Hi,

            I am trying to do as mhulsman suggested but I need an example on how to implement the method in the class that is being called.

            Thanks

            Comment

            Working...
            X