Customizing CKEditor's toolbar during runtime - javascript

I have a website using CKEditor. Now I want to customize the toolbar "live" during runtime, without having to create a new instance of the editor.
Is there a way to do that?

I have got solution.I am using ckeditor.replace and it works now.
I am destroy the existing instance and then try to use replace.Actually replace will create a new instance.

Related

Monaco editor creating an instance without providing the editor container

I want to inject the Monaco editor html code through javascript. However, the create function for the editor always asks for the container div.
monaco.editor.create(document.getElementById('container-div'),{options})
Is there an option to create the instance without providing the wrapper and storing it in a variable so that I can use it or inject it via javascript later on?
Not sure what the problem is. Just create a new HTML element as container and use that for injection.

Code Editor Syntax Highlighter with Multiple Instances for JavaScript and HTML?

I have tried CodeMirror for creating a simple code editor with syntax highlighting using simple javascript and html, but the problem is that in my project I have multiple html Tabs, and on for each tab I need a CodeMirror instance.
I don't have any problems creating multiple instances, the problem is that I have only one button that when is clicked needs to read the content of the CodeMirror instance that is in the current Tab and send its content to an Http service, so I can’t find the best way to find the correct CodeMirror instance when the button is clicked.
So I what recommendations could you give me ? or is a better idea to try with other libraries like Ace or Prism for code highlighting?. Thanks.
I have tried using localStorage to save instances of CodeMirror but it retrieves me an error of Converting circular structure to JSON.

Angular interpolation,directive,ngModel does not work

Currently i'm trying to customize Ngx-Editor to add feature like Table in the editor.
the editor is base on textarea and i create table using document.createElement() and insert into textarea using document.execCommand('insertHTML').
but the problem is i want a popover on the table if click and right-click feature so that a popup can be raise to edit the existing table.
but using any interpolation or directive in table does not work.
like {{somecontent}} is printed as it is.
so is there any way to create Table with popover and context-menu outside angular context.
i'm using Angular 4.
It doesn't work because you're adding code to your application post-build.
Ask yourslef : is {{ someContent }} valid vanillaJS code ? If you write this in a Javascript file, will it work ?
No. Because this is an Angular syntax, and it's read by the compiler to be translated into vanillaJS.
Furthermore, you should not manipulate the DOM yourself when using Angular. The framework is supposed to handle that for you.
If you want a custom component, you have to create one from scratch (or fork an existing one). You can't extend a component on the fly.

How to create customize Html Editor in Extjs

I have requirement to create Customize Ext JS HTML Editor. I am facing problem in creating it.
Since you're not providing any information at all there are several solutions:
You can use CSS to style your HTML editor
You can use another editor, like TinyMCE to add extra functionality
You can have a look at the documentation on how to alter functionality of the current editor any maybe even create a subclass of it.
Hope this helps a bit.

Is there a way to get an instance of SlickGrid from an element

Just starting to use SlickGrid and it doesn't seem to initiate itself like a normal jquery widget/plugin does where you can access the instance attached to the element by just doing $(element).slickgrid() .
Is there a way to get a hold of the existing instance, without obviously holding onto it when you create it? Looking through the code it didn't seem like it, but wasn't sure if anybody else had run into this.
Not exactly sure why they took dependencies on jquery but decided to have a custom initialization.
Could be as simple as just wrapping it in a jqueryui widget.
You could always use jQuery's data function to save a reference to the slick grid instance.
For example:
var grid = new Slick.Grid(container,data,columns,options);
$(element).data('slickgrid', grid);
And you can access it using:
$(element).data('slickgrid');
I find these kinds of questions kinda funny. Just because something uses the jQuery library, it doesn't automatically make it a jQuery plugin or a jQueryUI widget. SlickGrid is neither, which is why it doesn't follow their design conventions or APIs.
That minor rant aside, Mark's answer is correct. If for some reason you want to store the instance variable with the DOM element, you can easily do that with $(element).data().

Categories

Resources