Announcement

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

    Simple hover for TileGrid

    I trying to get hover message for TileGrid example:
    https://www.smartclient.com/smartcli...ingCustomTiles
    I have add canHover: true and showHover: true and ... nothing happens

    I tryed to find method like
    getCellHoverComponent (record, rowNum, colNum)
    And not found it for TileGrid...

    After that follow method had been added:
    getHoverHTML: function(record){return '1234';},
    And ... "12345" showing on the border of tile. It dissapered on inside of tile.

    So what is the way to hover message forTileGrid? It is not yet clear
    For example message should contains "title" (or any another) field

    #2
    Instead of applying a custom 'getHoverHTML' method to the TileGrid as a whole, you need to apply it to the individual tiles.
    An easy way to do this is to use the "autoChild" pattern described here: https://www.smartclient.com/smartcli...autoChildUsage
    In this case the tiles are "Multi Auto Children" named "tile", as described here: https://www.smartclient.com/smartcli....TileGrid.tile - so will pick up "tileProperties".
    They are instances of SimpleTile by default, so you can use 'getRecord()' to get the record associated with each tile.

    Here's some example code demonstrating this approach on the "Basic Tiling" sample here.

    Code:
    isc.TileGrid.create({
        tileWidth:150,
        tileHeight:190,
        height:"100%",
        width:"100%",
        tileProperties:{
            getHoverHTML : function () {
                var tileRecord = this.getRecord();
                return tileRecord.information
            }
        },
        showAllRecords:true,
        data:animalData,
        fields: [
            {name:"picture", type:"image", imageURLPrefix:"../inlineExamples/tiles/images/"},
            {name:"commonName"},
            {name:"status"}
        ]
    });
    Regards
    Isomorphic Software
    Last edited by Isomorphic; 14 Dec 2021, 13:29.

    Comment


      #3
      Thank you there much!

      Comment

      Working...
      X