Results 1 to 3 of 3

Thread: Grid inside a Window will not appear

  1. #1
    Sencha User
    Join Date
    Mar 2019
    Posts
    5

    Default Grid inside a Window will not appear

    I'm trying to create a dialog box that pops up with a text entry field, a small datagrid, and two buttons... everything works but the grid will not appear. I'm sure its something simple I overlookeed, but I am new to ExtJS... simplified code follows. Any suggestions?

    Code:
    Ext.define('SimpsonUser', {    extend: 'Ext.data.Model',
        fields: ['name', 'email', 'phone']
    });
    
    var simpsonStore = Ext.create('Ext.data.Store', {
        model: 'SimpsonUser',
        data: [
            {name: 'Lisa', email: '[email protected]', phone: '555-111-1224'},
            {name: 'Bart', email: '[email protected]', phone: '555-222-1234'},
            {name: 'Homer', email: '[email protected]', phone: '555-222-1244'},
            {name: 'Marge', email: '[email protected]', phone: '555-222-1254'}
        ]
    });
    // Grid
    var simpsonGrid = Ext.create('Ext.grid.Panel', {
    
        store: simpsonStore,
        width: 400,
        height: 200,
        title: 'Application Users',
        columns: [
            {
                text: 'Name',
                width: 100,
                sortable: false,
                hideable: false,
                dataIndex: 'name'
    },
            {
                text: 'Email Address',
                width: 150,
                dataIndex: 'email',
                hidden: true
    },
            {
                text: 'Phone Number',
                flex: 1,
                dataIndex: 'phone'
    }
        ]
    });
    
    Ext.define('csssui.view.batch.NewBatch', {
    
        extend: 'Ext.window.Window',
        xtype: 'newbatch',
    
        requires: [
            'Ext.form.Panel',
            'Ext.grid.Panel',
            'Ext.button.Button',
            'Ext.form.field.Text',
            'Ext.form.field.ComboBox'
    ],
    
    
        title: 'Batch',
        controller: "batchsetup",
        viewModel: {
            type: "batchsetup"
    },
        bodyPadding: 10,
        title: 'New Batch',
        closable: false,
    
        cls: 'plate',
    
        items: {
            // xtype: 'form',
            reference: 'batch-form',
    
            items: [
                {
                    xtype: 'textfield',
                    name: 'batchId',
                    fieldLabel: 'Batch ID:',
                    allowBlank: false,
                    enableKeyEvents: true
                 },
                simpsonGrid
             ]
        },
    
        buttons: [
            {
                text: 'Create',
                listeners: {
                    click: 'onCreateDept'
    }
            },
            {
                text: 'Cancel',
                listeners: {
                    click: 'onCancel'
    }
            }
        ]
    });

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Thank you so much for your post. I apologize for the delay. I have shared this with the support staff to look into at their earliest convenience. Your patience is greatly appreciated!

    Thanks again,

    Michele


  3. #3
    Sencha Premium User
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    337
    Answers
    62

    Default

    See below. I commented out the controller and viewModel configs since you did not include code for those.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •