I was not able to find for TileGrid a functionality similar to getRollOverCanvas from ListGrid. Does anyone know how this could be achieved? Or someone from Isomorphic can say if this feature might be included for a future version?
Announcement
Collapse
No announcement yet.
X
-
Ok... In this case I suppose that this method should be used within a MouseOverHandler over the TileGrid. But it seems buggy as it is not always returning the tile under the mouse. Please see attached updated TestCase.
Second issue is that the method always returns null if I use a tile customizer. To reproduce this problem just unckeck the lines 219-225 and you will see that nothing is displayed anymore within the log console.
Using v12.0p_2020-02-08/LGPL Development Only (built 2020-02-08)Attached Files
Comment
-
Your test case mixes GWT and SmartGWT widgets - see the FAQ, don't do this. Let us know if you can reproduce flaky events without introducing GWT widgets.
As far as the tile customizer, if you are creating your own tiles then we cannot install our standard functionality. But in that case, you can simply add a MouseOver event to your custom tile, so it's trivial to find out the tile the mouse is over.
Comment
-
I am not using any GWT widgets. But if you are referring to line 65Code:RootPanel.get().add(panel);
Code:panel.draw();
Regarding the custom tile, it is extending SimpleTile as you recommend. Anyway the idea was to have a roll over functionality (as seen on ListGrid) on top of the current tile and not to change the layout of the current tile. How can that be done?
Comment
-
Sorry if we were unclear, but using RootPanel.add() is tantamount to mixing widgets - the "RootPanel" introduces a bunch of GWT DOM and event handling code.
But that's not actually the problem - it looks like you're just listening to mouseOver on the TileGrid, which can't work - easiest approach is to use mouseMove and detect that the current tile has changed.
Or again use a customizer and use standard mouseOver functionality or a widget that has a mouseOver behavior of changing CSS styles (eg Label).
So again you've got two working approaches.
Comment
-
Some background of what I want to do: When the user goes with the mouse over a tile I want to display a canvas with a set of icons(ImgButtons more precicely) over that tile. Each icon will have a click handler with a certain action associated. I have this behavior on a tree grid using the getRollOverCanvas and also want it on a tile grid. This can not be done through CSS.
With the mouseMoveHandler the getCurrentTile() method always return a tile even if I am not over a Tile. I still think there is a bug there but it is up to you if you want to fix it or not...
Since I am using a custom SimpleTile it seems that the mouseOverHandler on it is the only solution. But there still are 2 problems:
1. I do not want to adjust the tile components and layout but rather to display a canvas over it just like getRollOverCanvas does
2. How will I know when the mouse is not over the tile anymore so I can hide the canvas?
Comment
-
Your suggestion seems to work except one thing. When you go with the mouse over the rollOverCanvas the tile starts to flicker. Probably because in that moment a mouseOut event for the tile is received which in turn hides the rollOverCanvas and also updates the default css styling for the SimpleTile class. How can this problem be overcome? Test case with the exposed behavior is attached.Attached Files
Comment
-
We've made a change to make behavior better here.
As of tomorrow's builds, getCurrentTile() will indeed return the tile that is currently under the mouse (as opposed to the last tile that was redrawn, either because you moved over it or any other reason) and this will be true whether you're using SimpleTile or a custom tile.
At that time, you'll just need a TileGrid mouseMove handler that calls getCurrentTile(), as you tried originally.
When you say it "starts to flicker", do you mean it just redraws (flickers) once, or starts flickering?
Comment
Comment