I think I'm following the docs correctly. All the columns are the same width (see attached screenshot), though I'm trying to get the "title" column to be as big as its content (which is I think what autoExpandColumn is for).
What am I missing?
Code:
Ext.ns('EAA.custom');
EAA.custom.DocumentGrid = Ext.extend(Ext.Panel, {
constructor: function(config) {
config = config || {};
var store = new Ext.data.Store({
autoLoad: true,
url: 'documents/listDocuments.html',
baseParams: {
start: 0,
limit: 50
},
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'count'
}, ['id', 'commonId', 'title', 'isbn'])
});
Ext.apply(config, {
layout: 'fit',
height: 400,
frame: true,
title: "Documents",
items: {
xtype: 'grid',
autoExpandColumn: 'title',
enableColumnHide: false,
store: store,
columns: [
{ header: 'DocID', dataIndex: 'id' },
{ header: 'CommonID', dataIndex: 'commonId' },
{ header: 'Title', dataIndex: 'title', id: 'title' },
{ header: 'ISBN', dataIndex: 'isbn' }
],
bbar: new Ext.PagingToolbar({
pageSize: 50,
store: store
})
}
});
EAA.custom.DocumentGrid.superclass.constructor.call(this, config);
}
});
Ext.reg('DocumentGrid', EAA.custom.DocumentGrid);
Code:
var documentGrid = new EAA.custom.DocumentGrid({
id: 'documentGrid',
renderTo: 'div_documentGrid'
});
<div id="div_documentGrid"></div>