I have an Ext.form.field.HtmlEditor-textfield with really long text inside it and I want to save only the currently visible portion of the text inside a variable.
For example:
var really_long_string = "...";
var html_editor = Ext.create('Ext.form.HtmlEditor', {
renderTo: Ext.getBody(),
value: really_long_string
});
var currently_visible = get_currently_visible_text_from_html_editor();
I don't think there are methods which do this, so I came up with an idea of calculating it myself doing these steps:
1.) get current size of the html_editor inside a 'resize' event-handler
2.) get the current scrollbar position of the html_editor
3.) calculate how many lines are visible, and find them using the scrollbar position
My Questions:
1.) Is there an ExtJs function which gives me the current scrollbar position of the html_editor-textfield?
2.) Does anyone have a better idea, how to get the visible portion of long text?