Custom Widget Designer Event Click
I have a number of custom widgets that work as intended. However, for the sake of keeping things clean and consistent I want them to display the same Icon and "Enter Content" message in the body area before they have been edited as the in built telerik controls do.
In terms of html this is simply a case of adding the following section to the page load for when the control is empty:
1.
<
div
class
=
"sfAddContentWrp"
>
2.
<
a
class
=
"sfAddContentLnk sfContentBlockIcn"
>
3.
<
span
>Enter content</
span
>
4.
</
a
>
5.
</
div
>
Hi Paul,
The click is handled by ZoneEditor client component. We get the ids of the all empty controls and send then through IScriptDescriptor on the client. There we get the control by Id using jQuery jQuery('#' + controlId);
and then using jQuery bind() we attach to click event type where we execute a function that calls the "edit" using execCommand client method.
emptyControl.bind("click", dock: dockControl , function (event)
thisObject.execCommand("edit", event.data.dock);
You need to the the same in your custom control.
Kind regards,
Ivan Dimitrov
the Telerik team