This is a migrated thread and some comments may be shown as answers.

CommandItem enable/disable SaveButton dynamically

3 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mathieu
Top achievements
Rank 1
Iron
mathieu asked on 27 Mar 2019, 02:19 PM

Hi community,

 

I have a radgrid in batch mode bound to a list of tests. The user has to select 1 to n rows by checking checkboxes.

Then, I have a javascript function (CheckRequirement) that checks the consistency of the selected rows (ie.: test1 require test2).

What I need to do is enable/disable the SaveButton depending on the CheckRequirement function result.

 

Any idea to do this on client side?

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 01 Apr 2019, 12:21 PM
Hi Mathieu,

The Grid does not expose an API for controlling the command item buttons externally, but you can achieve that by disabling the mouse-pointer events of the Save button with a similar jQuery logic:
$telerik.$(".RadGrid button.rgSave").css('opacity', 0.5).css("pointer-events", "none");
 
//enable
//$telerik.$(".RadGrid button.rgSave").css('opacity', 1).css("pointer-events", "auto");


Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
mathieu
Top achievements
Rank 1
Iron
answered on 05 Apr 2019, 06:51 AM

Exactly what I needed.

Thank you Vessy

0
Vessy
Telerik team
answered on 05 Apr 2019, 07:33 AM
Hello,

You are welcome, mathieu - I am glad I managed to help :)

Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
mathieu
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
mathieu
Top achievements
Rank 1
Iron
Share this question
or