Disabling button in client-side script

5 posts, 0 answers
  1. Andrej
    Andrej avatar
    5 posts
    Member since:
    Sep 2008

    Posted 04 May 2011 Link to this post

    Hello there

    I am trying to disable button in ribbon bar in client-side script. After building pretty complex script to get reference to button item I called set_enabled(false) and nothing happened. I think problem is in set_enabled function in:
    set_enabled: function (c) {
    		if (this._element) {
    			return;
    		} if (c) {
    			b(this._element).attr("disabled""disabled");
    		} else {
    			b(this._element).removeAttr("disabled");
    		}
    	}

    if this._element is set, return is called. I think it should be opossite. Or am I doing something wrong?
    I was able to disable the button with hard-code hacks in js. But disabled image is not used.

    Another problem is that when I disable button even from server-side, button text looks like disabled and
    button frame is not shown. But I am still able to click the button and I am redirected to '#'.





    BTW:




    How can I easily find reference to button item in js?

    Thank you very much.

    Kind regards
    Andrej

  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 09 May 2011 Link to this post

    Hello Andrej,

    Thank you for reporting the problem with set_enabled method - I have logged it and as soon as we fix the issue, we will notify you in this same thread. Your telerik points are updated.

    "How can I easily find reference to button item in js?"
     - You can use the findItemByText method on the RibbonBar client-side object representation.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andrej
    Andrej avatar
    5 posts
    Member since:
    Sep 2008

    Posted 10 May 2011 Link to this post

    Thanks Nikolay.

    "How can I easily find reference to button item in js?"
    - You can use the findItemByText method on the RibbonBar client-side object representation.

    Problem is that Text is translated in our solution. So I am looking for way how to identify the button with some internal constant id. Is there some solution for this? If not, it would maybe be good idea for future release.

    Regards
    Andrej
  5. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 12 May 2011 Link to this post

    Hello Andrej,

    We are planning on implementing CommandName property on the action items (items that can trigger an event for example click). There you will be able to assign the additional identification for your items. FindItemByCommandName method will be provided additionally so you can use the property for searching.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Andrej
    Andrej avatar
    5 posts
    Member since:
    Sep 2008

    Posted 12 May 2011 Link to this post

    That sounds great. Thank you very much.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017