Author Topic: link render  (Read 274 times)

Maino

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 25
    • View Profile
link render
« on: February 16, 2024, 10:05:06 am »
Is it possible to make certain columns look linked like photos? I want the mouse to change its shape if I put the mouse on the data value like the color column.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: link render
« Reply #1 on: February 16, 2024, 11:18:14 am »
Yes, please use column.render to draw links in the cells and column.postRender to attach mouseover, mouseout events to the cell.

Example of displaying links in the cells ( Athlete column ): https://paramquery.com/pro/demos/export_pdf

postRender callback:

Code: [Select]
postRender: function(ui){
var $cell = $( ui.cell );
$cell.on('mouseover', ()=>{
$cell.css('color', ui.rowData.color ); //where rowData.color is hexadecimal value of color to be stored in corresponding row.
//$cell.css('color', '#00ff00' );
}).on('mouseout', ()=>{
$cell.css('color', '' ); //unset the color on mouseout.
});
}

and set postRenderInterval: 0,in the main grid options.
« Last Edit: February 16, 2024, 11:36:53 am by paramvir »