1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    13
    Vote Rating
    1
    LuckyBlade is on a distinguished road

      0  

    Default Answered: Insert Ext component into grid cell

    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
      Sencha - Support Team scottmartin's Avatar
      Join Date
      Jul 2010
      Location
      Houston, Tx
      Posts
      9,076
      Answers
      674
      Vote Rating
      467
      scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

        0  

    Thread Participants: 1

    Tags for this Thread