Hiding closeicon when showGridLines is false

Dear support.

I added my closeicon as in the answer https://www.syncfusion.com/forums/170605/adding-close-icon-to-panel-item?reply=S8AWKr


Is there a way to hide this when for example the param showGridLines is set to false..

Regards


Geirr


1 Reply 1 reply marked as answer

SS Sharon Sanchez Selvaraj Syncfusion Team November 24, 2021 01:04 PM UTC

Hi Geirr, 
 
Greetings from Syncfusion support. 
 
We have checked with your requirement along with the attached forum link. We have included a button, where you can toggle the functionality of GridLines to true and false. We have modified the visisbility of the close icon at those scenarios. 
 
Refer to the code snippet: 
 
gridLine: function (args) { 
      this.gridLines = !this.gridLines; 
      var closeIcon = document.querySelectorAll("#close"); 
      for (var i = 0; i < closeIcon.length; i++) { 
        if (this.gridLines) { 
          closeIcon[i].style.visibility = "visible"; 
        } else { 
          closeIcon[i].style.visibility = "hidden"; 
        } 
      } 
    }, 
 
Refer to the sample: 
 
 
Please get back to us if you need any further assistance. 
 
Regards, 
Sharon Sanchez S. 


Marked as answer
Loader.
Up arrow icon