Results 1 to 2 of 2

Thread: Unable to load editable grid

  1. #1

    Default Unable to load editable grid

    Hi all, I've want to make my grid as editable, i used the code as follows,


    var Contacts = Ext.create('Ext.data.Store', {
    model: 'Contact',
    data: [
    {name: 'Loiane', email: '[email protected]', phone: '1234-5678'},
    {name: 'Peter', email: '[email protected]', phone: '2222-2222'},
    {name: 'Ane', email: '[email protected]', phone: '3333-3333'},
    {name: 'Harry', email: '[email protected]', phone: '4444-4444'},
    {name: 'Camile', email: '[email protected]', phone: '5555-5555'}
    ]
    });
    var firstGrid = new Ext.create('Ext.grid.Panel', {
    renderTo: Ext.getBody(),
    frame: true,
    store: Contacts,
    width: 350,
    title: 'Contacts',
    selType: 'cellmodel',
    columns: [{
    text: 'Name',
    flex: 1,
    dataIndex: 'name'
    },{
    text: 'Email',
    flex: 1,
    dataIndex: 'email',
    editor: {
    xtype:'textfield',
    allowBlank:false
    }
    },{
    text: 'Phone',
    flex: 1,
    dataIndex: 'phone',
    editor: {
    xtype:'textfield',
    allowBlank:false
    }
    }],
    plugins: [
    Ext.create('Ext.grid.plugin.CellEditing', {
    clicksToEdit: 1
    })
    ]
    });


    //Simple 'border layout' panel to house both grids
    var displayPanel = new Ext.Panel({
    width : 720,
    height : 300,
    layout : 'hbox',
    renderTo : 'panel',
    defaults : { flex : 1 }, //auto stretch
    layoutConfig : { align : 'stretch' },
    items : [
    firstGrid
    ],
    bodyStyle: 'background-color:#E6ECF4;border:none;',
    });








    This code returns following error,
    error in rendering Json :TypeError: types[config.xtype || defaultType] is not a constructor


    Can Anyone help me ?..
    Thanks in advance...

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Do you have all the classes loaded that this example uses?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

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
  •