mikes grid stuff

by Johan Vandeplas

HTML

<script src="http://cdn.sencha.io/ext-4.2.0-gpl/ext-all-dev.js"></script>
<link rel="stylesheet" href="http://cdn.sencha.io/ext-4.2.0-gpl/resources/css/ext-all.css">

JavaScript

Ext.onReady(function () {
    Ext.define('Glyph.view.story.List', {
        extend: 'Ext.grid.Panel',
        alias: 'widget.storylist',
        store: Ext.create('Ext.data.Store', {
            fields: ['text'],
            data: [{
                text: 'test'
            }]
        }),
        title: 'Story',
        frame: false,
        frameHeader: false,
        hideHeaders: true,
        header: false,
        columns: [{
            header: "",
            flex: 1
        }],
        viewConfig: {
            plugins: [
            Ext.create('Ext.grid.plugin.DragDrop', {
                dragText: 'grid  and drop to reorganize',
                ddGroup: 'snippets',
                enableDrop: false
            })]
        }
    });

    Ext.define('Glyph.view.story.StoryFormAndGrid', {
        extend: 'Ext.panel.Panel',
        alias: 'widget.storyformandgrid',
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        items: [{
            xtype: 'form',
            name: 'storyform',
            alias: 'widget.storyform',
            model: 'Glyph.model.Story',
            title: 'Form',
            defaults: {
                margin: 5
            },
            dockedItems: [{
                xtype: 'toolbar',
                dock: 'top',
                items: [{
                    xtype: 'button',
                    text: 'cancel',
                    action: 'cancel'
                }, {
                    xtype: 'button',
                    text: 'save',
                    action: 'save'
                }]
            }],
            items: [{
                xtype: 'textfield',
                name: 'title',
                fieldLabel: 'Title',
                labelAlign: 'top'
            }]

        }, {
            xtype: 'storylist',
            flex: 1
        }]
    });
    Ext.widget('storyformandgrid', {
        renderTo: Ext.getBody()
    });
});