Hover on cell to change the src img element.

I have an img tag in the data source of Grid. And I want to change the src if I click/hover to that specific img tag. How can I do this? JQuery/Javascript selectors seems can't find those img elements.



1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team May 29, 2018 01:54 PM UTC

Hi Robin, 

Thanks for using Syncfusion products. 

We have achieved your requirement using click event. In that event, we can find the corresponding cell which has image tag value and bound the click event as well as we have changed the src attribute value while clicking the image tag column. Please refer to the following code example, 
  grid.on('click', function(e){  
           
          if(e.target.tagName == 'IMG'){ 
              //Change the src attribute value while click the cell 
              e.target.src = 'www.syncfusion.com' 
              } 
        } 
              ); 
           
 
 
Please let us know if you have any further assistance on this. 
 
Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon