Hi Mohamed,
Thank you for contacting Syncfusion Support.
Yes, you can render AutoComplete inside RichTextEditor by loading stylesheet through externalCSS property and load scripts into iframe through create event of RTE as shown below. Render input element as AutoComplete by navigating from iframe id.
|
<textarea id="rteSample" rows="10" cols="30" style="width: 740px; height: 440px">
AutoComplete:
<div id="control">
<input type='text' id='selectState'/>
</div>
</textarea>
$(function () {
});
function oncreate(args)
{
var iframeDoc = this.getDocument();
var jQuery = document.createElement("script");
jQuery.type = "text/javascript";
iframeDoc.head.appendChild(jQuery);
var scriptTag = document.createElement("script");
scriptTag.type = "text/javascript";
iframeDoc.head.appendChild(scriptTag);
$('#rteSample_Iframe').contents().find("#selectState").ejAutocomplete({
dataSource: states,
fields: { key: "index", text: "countryName" },
watermarkText: "Select a state",
width: "300"
});
}
</script>
<style>
#selectState_suggestion
{
top:126px!important;
left:35px!important;
}
</style> |
As popup position will be calculated based on window top and left value, we suggest you to mention top, left values for popup in style section to render it in correct position. Please refer to the below sample
If we have misunderstood, kindly revert us with clear details on your requirement so that we can proceed further.
Regards,
Keerthana.