We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Disable command button of a row based on value

Hi,

I'm trying to disable a command button of a row based on value but I cannot get the instance of the command button to disable it. I'm using this thread:


The QueryCellInfo is working fine and the conditional, but I cannot get the instance of any command button of the row:


Do I missing something??? I attached the view that I'm using.

Thanks, regards!


Attachment: Index_d8092e03.zip

4 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team October 7, 2019 09:31 AM UTC

Hi Daniel, 
 
Greetings from Syncfusion. 
 
The forum 137527, belongs to the EJ1 Grid which runs on the jQuery. To disable the command column button in the Essential JavaScript 2 Grid, you have to use the following method.  
 
function onQueryCell(args) { 
        if (args.cell.classList.contains('e-unboundcell') && args.data.OrderID % 2== 0) { 
           args.cell.querySelector("button[title='Details']").ej2_instances[0].disabled=true; 
        } 
} 


We have prepared a sample demo, 


Regards,  
Seeni Sakthi Kumar S 



DA Daniel October 7, 2019 06:04 PM UTC

Thanks, this works.

Regards!


DA Daniel October 7, 2019 06:41 PM UTC

Another quick question, how to get the row and put the background in a different color?

Thanks, regards!


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team October 8, 2019 09:04 AM UTC

 
We have already discussed about customizing cells using the queryCellInfo event. Refer to the following Help Document. 
 
 
Regards,  
Seeni Sakthi Kumar S 



Loader.
Live Chat Icon For mobile
Up arrow icon