Announcement

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

    Showing Links in a Grid Field

    Hi all,

    is it possible to show only the name of an image in a dataGrid link field but to 'call' the complete URL when one clicks on it.

    E.g. to show 'image.jpg' and to get http://host/<path-to-image>/image.jpg when you click on the link.

    Many thanks in advance
    Fabio

    #2
    Things to try...

    You could:
    1. Add a TEXT column that shows the url
    2. Add an IMAGE column that is initially empty
    3. When a cell in the text column is clicked, set the value on the IMAGE column to the value of the TEXT column, and it should display the image. Call markForRedraw () if it does not

    If you want to do this all in a single-column, you could:
    1. Add a TEXT column that shows the URL
    2. When a cell in the text column is clicked, set the value of the cell to the value returned by Canvas.imgHTML (imageUrl). Call markForRedraw () if it does not

    You could also make the column a record component where you draw an horizontal layout with a label containing the url, and after it is clicked, replace it with the image, or append the image to it?

    If you need the text to look like a link, you can try to set its style to "hyperlink", and add this to your Application.css file:
    Code:
    .hyperlink {
      color: blue;
      font-size:12px;
      font-family:Arial, Helvetica, sans-serif;
      text-decoration:underline;
      cursor: pointer;
    }

    Comment

    Working...
    X