Announcement

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

    XY Location when ListGridRecord is clicked?

    SmartClient Version: SC_SNAPSHOT-2011-01-06/PowerEdition Deployment (built 2011-01-06) / GWT 1.7.1


    How can I get the location of the ListGridRecord when clicked?

    I need to:

    window.setTop(getPageTop() + getHeight());
    window.setLeft(getPageLeft());
    window.bringToFront();
    window.show();

    On top of the ListGridRecord. The way the code above works is it puts the Window at the very bottom of the container in which the ListGrid lives in.

    #2
    If you just want to place the Window at the mouse, you can use EventHandler.getX()/getY().

    If you want to place it precisely under the record, this is a little harder due to scrolling: in pseudocode, you want:

    body = grid.getGridRenderer();
    body.getPageTop() + (grid.getCellHeight() * grid.getEventRow()) - body.getScrollTop()

    Comment


      #3
      Looking through your Showcase online, could I follow the same idea as the Custom Cell Editors and create my own editor that pops up? The only difference is I will not be changing the value of the cell, but rather doing a bunch of other things related to the cell?

      Comment


        #4
        There's a few possibilities - since you're putting something right under the record and it's not an editor, you might consider expandable rows.

        The Custom Cell Editors sample is really showing having *different types* on every row, but you could use listGridField.editorType to add a FormItemIcon that pops up a Window.

        Comment


          #5
          listGridField.editorType does not take type FormItemIcon? I really like this direction...but I don't think the FormItemIcon will work? Unless I didn't get your suggestion clearly?

          Comment


            #6
            listGridField.editorType takes a FormItem, which in turn takes a FormItemIcon via setIcons().

            If you basically want a static display of the value plus an icon, use StaticTextItem as the FormItem.

            Comment

            Working...
            X