Get Image info from a Grid Column

Hello,
I’m using 5.0 Pro and building my grid via XML. The first column header is as follows:

img:[/rsc/images/img/excel.gif]

When I press the top corner of the grid, I would like to get the IMG information. Is his possible? Any Ideas or solutions would be greatly appreciated.

Steve

Hello @stevenorris,

You may try to use the following flow:

//getting first header cell:
headerCell = myGrid.hdrBox.querySelector('div.hdrcell')
//or, you can use:
//headerCell = myGrid.hdrBox.querySelectorAll('div.hdrcell')[0]
//if the position may change in future

//getting the image from the header cell:
img = headerCell.firstChild

//getting the info about the image:
console.log({
  src: img.src,
  alt: img.alt,
  width: img.width,      // Display width
  height: img.height,    // Display height
  naturalWidth: img.naturalWidth,   // Intrinsic width
  naturalHeight: img.naturalHeight  // Intrinsic height
})

I’m not sure about your trigger: “press the top corner of the grid”. So, could you please clarify some details if the issue is still actual. Thank you.

Warm regards,