Question

I try to working with HTMLEditor in http://jsfiddle.net/WEEU3/
But when i chose Numbered list or Bullet list to typing then i press enter keyboard. That like enter image description here

I think that like

1. first
2. second
3. third

And when i focus in third. I press to un-numbered. I think that like

    1. first
    2. second
third

But all word will be un-numbered How to fix that. Thanks so much

Was it helpful?

Solution

It looks like there is a bug with htmleditor on 4.1.1. Also, you should NOT be using new to create the ExtJS objects. This will cause other ExtJS problems.

Upgrading to 4.2.x will fix your problem with the htmleditor.

Your code should be better formatted. You should also be using proper ExtJS methods to get items i.e. :

Ext.create('Ext.form.Panel', {  // should be using Ext.create(), not new
    title: 'HTML Editor',
    width: 500,
    bodyPadding: 10,
    renderTo: Ext.getBody(),
    items: [{
        xtype: 'htmleditor',
        name: 'editor',
        enableColors: true,
        enableAlignments: false,
        enableLists: true,
        enableSourceEdit: false,
        anchor: '100%'
    }],
    dockedItems: [{
        xtype: 'toolbar',
        items: [{
            xtype: 'button',
            text: 'Get HTML',
            handler: function(btn) {
                // example of getting all form values
                console.log(btn.up('form').getForm().getValues()); 

                // proper example of getting by component
                alert(btn.up('form').down('htmleditor').getValue());
            }
        }]
    }]
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top