Results 1 to 2 of 2

Thread: Insert Ext component into grid cell

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    13
    Vote Rating
    1
      0  

    Default Answered: Insert Ext component into grid cell

    Hello! I wanna insert Ext component, such as button or text field into grid cell. Here is simple part of code:
    Ext.create('Ext.data.Store', {
    storeId: 'simpsonsStore',
    fields: ['name', 'email', 'phone', 'test'],
    data: { 'items': [
    {'name': 'Homer', "email": "home@simpsons.com", "phone": "555-222-1244" },
    ]
    },
    proxy: {
    type: 'memory',
    reader: {
    type: 'json',
    root: 'items'
    }
    }
    });
    var id = Ext.id();
    var testGrid = Ext.create('Ext.grid.Panel', {
    title: 'Simpsons',
    store: Ext.data.StoreManager.lookup('simpsonsStore'),
    autoRender: true,
    columns: [ {
    flex: 1,
    text: "test",
    renderer: function (value, meta, record) {
    return "<div id=" + id + "></div>";
    },
    dataIndex: "test"
    },
    { header: 'Name', dataIndex: 'name' },
    { header: 'Email', dataIndex: 'email' },
    { header: 'Phone', dataIndex: 'phone' }
    ]
    });
    var textfield = new Ext.create("Ext.form.TextField", {
    renderTo: id
    });
    testGrid.show();
    It's not working. Error : Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null. What am I doing wrong? This idea from http://www.rahulsingla.com/blog/2011...ns#comment-853



  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,390
    Answers
    716
    Vote Rating
    498
      0  

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
  •