This is a migrated thread and some comments may be shown as answers.
Find UpdateButton
4 Answers 6 Views
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 04 Aug 2014, 12:46 PM
Hi,

since there is no "readonly appointment" I try to disable the update button in clientFormCreated.

My problem - I can't find it...


Subject works fine - button not...

function clientFormCreated(sender, args) {
    var $ = $telerik.$;
    var mode = args.get_mode();
    if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert || mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
        //var rUpdButton = $telerik.findButton($("[id$='Form_UpdateButton']").attr("id")); //findButton not existing although it shows in intellisense
        var rUpdBJQueryObject = $telerik.$("[id$='Form_UpdateButton']");
        var rUpdBRadButtonObject = $find(rUpdBJQueryObject.attr("id")); //always null
 
        var rSubject = $telerik.findTextBox($("[id$='Form_Subject']").attr("id"));
        rSubject.disable(); //works


I guess I do something wrong..

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 05 Aug 2014, 11:17 AM
Hello ManniAT,

The issue is observed because the Save button in not a Telerik control but an LinkButton and that is why $find is not finding it.

You can use jQuery and prevent the click event of the button as in the code below:
var rUpdBRadButtonObject = $find(rUpdBJQueryObject.attr("id"));
      rUpdBJQueryObject.click(function () {return false;});


Please have in mind that in case of Insert the button have to be found with InsertButton instead of UpdateButton.

Hope this information will be helpful. 

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
ManniAT
Top achievements
Rank 2
answered on 05 Aug 2014, 12:19 PM
Hi Palmen,

I tried your solution - the problem - the user thinks it would work...

I changed it to
var rbObj = $("[id$='Form_UpdateButton']");
            rbObj[0].disabled = true;
            rbObj[0].style.visibility="hidden";

Before I tried only to disable - but the button (although not firing) looks "working" (hover effects and so).

Manfred
0
Accepted
Plamen
Telerik team
answered on 07 Aug 2014, 07:23 AM
Hello Manfred,

I could not quite understand if you have further questions or the information was enough and  you have handled the issue already. 

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
ManniAT
Top achievements
Rank 2
answered on 07 Aug 2014, 07:40 AM
Hello Plamen,

sorry I forgot to mark this as answered (found a solution with your help).
I just posted to make clear that your approach just shows a "not working button" (which confuses the users) and also posted my final result which hides the button to make clear that save is not possible

Manfred
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Plamen
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or