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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disable command button of a row based on value

Thread ID:

Created:

Updated:

Platform:

Replies:

148095 Oct 4,2019 09:33 PM UTC Oct 8,2019 09:04 AM UTC ASP.NET MVC - EJ 2 4
loading
Tags: Grid
Daniel
Asked On October 4, 2019 09:33 PM UTC

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

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On 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 


Daniel
Replied On October 7, 2019 06:04 PM UTC

Thanks, this works.

Regards!

Daniel
Replied On 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!

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On 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 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon