Customising the REST Grid...

We have been using REST grids to show external data and this works fine.  We now have a requirement for one of the columns to be a hyperlink and to also make the data in these grids to be selectable.

I have spent a while looking into this and I think there are various options, but all of which seem to be quite complicated and I can't help but feel that I am missing something obvious.

For example instead of rendering the REST Grid Widget as a Grid, I can render this as Tiles and then specify my own tile content to render a table row with an anchor tag within a table cell.  This gives me my hyperlink but I lose all the extra functionality (column sorting, filtering, etc.) that comes with rendering as a grid.

After reading a similar forum post I have discovered that I might be able to intercept and modify the JSON data using an AddResultCallback and potentially change my data into a HTML anchor tag.  I haven't actually tried this yet, but this would be fine providing the REST grid would render HTML data as HTML.

However, the thing I seem to be having most trouble with at the moment is trying to make the REST Grid data selectable.  I have been trying to look through the HTML, CSS and JavaScript on the page to see what is going on.  I can see there is an "unselectable" class and attribute on the parent table cell and a disableSelection function in utilities.js, etc. but I can't seem to be able to make the grid data selectable. 

In this case I am thinking of not using the REST Grid at all and creating my own grid, but this seems extreme and I am sure there must be some CSS class or element I can use to make the grid data selectable.  I don't want to spend ages implementing some custom solution if there is some simple solution I am missing.

So, I suppose my specific questions that would help me are...

1.  How can you make REST grid data selectable?

2.  Can REST grid data be transformed to anchor tags in AddResultCallback 

3.  Can REST Grid Widget be rendered as tiles while keeping render as grid functionality?

What would also help is if anyone has any Tile content templates to render data in a table or grid that looks good in SBM, makes use of the default styling, etc.  Although I think this would be tricky, for example I don't think you could easily render as Tiles and create a single table row for column headings.

It would be good if anyone has any suggestions or experience on this.  As mentioned above I think I could spend a lot of time on this when I feel there is probably a simple solution that I am missing.

  • Verified Answer

    1.  How can you make REST grid data selectable?

    2.  Can REST grid data be transformed to anchor tags in AddResultCallback 

    3.  Can REST Grid Widget be rendered as tiles while keeping render as grid functionality?

    In answer to question 2, I was able to do this by following this article...

    /it_ops_mgt/sbm/w/sbm_tips/30123/sbm-composer-11-0-modifying-rest-data-before-it-is-rendered

    In my case the API request was returning an "id" property that was a number, but I was able to modify the property to be a HTML fragment... i.e. an anchor tag that surrounds the number and has a href that also contains this number.  The HTML fragment renders fine to the page so I was able to use this method to add hyperlinks into the REST Grid Widget.

    Question 3 becomes less important as I now have some control when rendering the REST grid as a grid.