SMART datagrid v.1 > Examples

Back  Forward

Link Cell Renderer  Example

If specify the renderer type as "link" when set the column, LinkCellRenderer object will draw the corresponding column cells and an event will be fired when click the corresponding cell. You can specify how to create the link differently when set the column renderer settings. 

In the grid below, "url" column specifies url property of the renderer, and "urlCallback" column specifies urlCallback property, and "urlField" column specifies urlField property. "value" column has only specified the renderer as "link", and in this case, the value of the data cell will be directly used as the value of this link. 

If showTooltip property is true, this URL will be displayed with a tooltip when the mouse is over the cell, and transferred to onClickableCellClicked event handler which is fired when click the cell. 

Grid - 1
rows
Code -1
    grdMain.onClickableCellClicked = function (grid, index, source, data) {
        // URL is contained in the data.
        if (data && data.indexOf('http') == 0) {
            window.open(data, '_newtab');
        } else {
            alert(data);
        }
    };

You can also specify the tooltip of the data set through ValueColumn.tooltipCallback or GridBody.tooltipCallback

View Source JSP 

See Also
LinkCellRenderer
DataCellRenderer.showTooltip
GridBase.onClickableCellClicked
Examples
Check Cell Renderer