Find UpdateButton

5 posts, 1 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 04 Aug 2014 Link to this post

    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..
  2. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 05 Aug 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 05 Aug 2014 in reply to Plamen Link to this post

    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
  5. Answer
    Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 07 Aug 2014 Link to this post

    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.

     
  6. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 07 Aug 2014 in reply to Plamen Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017