ExtJS 3: HtmlEditor Clear All Tags Button

Posted By Vitaliy | February 02, 2014 | ExtJS 3.4.0
0 3589
We can make this button as a simple plugin for HtmlEditor.

Js Code

Ext.form.plugin.ClearTags = Ext.extend(Ext.util.Observable, {
    regex: /(<([^>]+)>)/ig,
    regexSpaces: /(\s|&nbsp;)+/g,
    ...
    onRender: function () {
        ...
        tb.addButton({
            ...
            handler: function () {
                var value = ed.getValue() || '',
                    result = value.replace(me.regex, ' ').replace(me.regexSpaces, ' ');
                ed.setValue(result);
            }
        });
    }
});
            

ExtJs 3.4.0 Grid Multiselect

Posted By Vitaliy | February 26, 2013 | ExtJS 3.4.0
1 3899
ExtJs 3 Grid has multiselect feature by default.

Js Code

new Ext.grid.GridPanel({
    title: 'Users',
    store: new Ext.data.JsonStore({
        fields: ['id', 'name'],
        data: [
            { 'id': 1, 'name': 'user-1' },
            { 'id': 2, 'name': 'user-2' },
            { 'id': 3, 'name': 'user-3' },
            { 'id': 4, 'name': 'user-4' }
        ]
    }),
    columns: [
        { header: 'id', dataIndex: 'id' },
        { header: 'name', dataIndex: 'name' }
    ],
    width: 300,
    height: 150,
    renderTo: Ext.getBody()
});