Create a Designer-less control

Posted by Community Admin on 04-Aug-2018 20:59

Create a Designer-less control

All Replies

Posted by Community Admin on 16-May-2012 00:00

Hello,
Is there a way for me to completely remove the "Edit" link from a control in design mode? I have a control which doesn't need a designer, so, removing that link would prevent confusion for the user. Does anyone have an idea on how to achieve this?
Thanks

Posted by Community Admin on 16-May-2012 00:00

No idea how to remove the 'Edit' link from the control container of the page editor, but what I tend to do with controls I don't want users to mess with, is do a 'if in admin-mode' type test, and if true, render a line of red text that basically says - don't mess with this control.

Posted by Community Admin on 17-May-2012 00:00

Here is a little jQuery snippet that'll take care of it:

$('.rdTitleBar:first-child:contains("MyWidget1")').each(function ()
    $(this).find('.rdCommands').find('.rdMoreCommand').attr('style', 'border: 0px !important').end().find('a[title="Edit"]').parent().hide();
);

Make sure to replace "MyWidget1" with the title of your widget.

Posted by Community Admin on 17-May-2012 00:00

That's great Tim, as soon as MB replied I thought "Hmm, I could do this with jquery", but then didn't get a chance to actually try it out. Thanks for your help!

This thread is closed