I looked in the docs and couldn't find any information on any event signalling a change to the contents.
I then looked in the source and found the text area and tried hooking to the change event. This doesn't appear to fire.
How do I detect any change to the html editor?
Hi,
There is "isDirty" method, but I don't think that this is what you're looking for. This method shows if the content is changed since the creation of the widget.
One way to listen for a change is to bind to keypress event of the editor. Editor itself is rendered as IFRAME so you should bind to the IFRAME's document.
Here is the sample code:
Best regards,
Martin Pavlov
Infragistics, Inc.
Also on this I got the keypress to work, but couldn't get blur to work. Ideas?
Still need a changed event for this and every other control so that it can be properly bound in every case for knockout and every other mvc or other environment.
(and every control needs to respond to and update the underlying input control that it was created from so that the value binding works on knockout and every other mvc/mvvm environment.
n/m
This works:
var frame = $("iframe", element).get(0); $(frame.contentWindow).blur(function (e) { value($(element).igHtmlEditor("getContent", "html")); });
Where element is the dom elment that is the igHtmlEditor.