Note that there are some explanatory texts on larger screens.

plurals
  1. POEXTJS 3: Set autoHeight and autoWidth to grid
    primarykey
    data
    text
    <p>I am using EXTJS 3, I have code like below. The headache parts are</p> <ol> <li>how to put atuo horizontal scrollbar to the Grid ?</li> <li>how to let the Grid capture the max height ? how to set auto vertical scrollbar to the Grid ?</li> </ol> <p>Currently, I have to manually set Grid to Frame and height . </p> <pre><code>frame: true, height: 500, </code></pre> <p>If I do this way, <strong>when user changes the IE size, the horizontal scrollbar will be disappeared</strong>. and I have tried the autoHeight and autoWidth , it still doesn't work.</p> <pre><code>//register this namespace Ext.namespace('MyPkg.Ui'); //create a class in this namespace MyPkg.Ui.Report = Ext.extend(Ext.form.FormPanel, { allowpaging: true, pageSize: 30, initComponent: function () { var period_start = new Ext.form.DateField({ id: 'PERIOD_START', fieldLabel: 'PERIOD START', format: 'm/d/Y', allowBlank: true, width: 250 }); var Store = new Ext.data.DirectStore({ autoLoad: false, paramsAsHash: false, paramOrder: 'PERIOD_START', root: 'Report', totalProperty: 'total', fields: [ { name: '_DETAIL_ID', type: 'string' }, { name: 'RUNID', type: 'string' }, .... ], remoteSort: false, listeners: { load: function (store, records, opt) { //Grid.setHeight(500); Grid.doLayout(); } } }); var pager = new Ext.PagingToolbar({ store: Store, displayInfo: true, pageSize: this.pageSize, listeners: { beforechange: function (paging, params) { var reportStore = Ext.StoreMgr.lookup('Store'); reportStore.setBaseParam('start', params.start); reportStore.setBaseParam('limit', this.pageSize); reportStore.setBaseParam('PERIOD_START', period_start.getValue()); } } }); var Grid = new Ext.grid.GridPanel({ store: Store, loadMask: true, stripeRows: true, frame: true, height: 500, colModel: new Ext.grid.ColumnModel({ defaults: { width: 120, sortable: true }, columns: [ {header: '', dataIndex: 'ROW_ID'}, { header: 'PRICING FEED', dataIndex: 'PRICING_FEED' }, { header: 'DATAFILE TREE', dataIndex: 'DATAFILE_TREE' }, { header: 'ADO LIST ID', dataIndex: 'ADO_LIST_ID' }, { header: 'FEED RUN DATE', dataIndex: 'FEED_RUN_DATE_STR' }, ..... ] }), viewConfig: { forceFit: false } }); var config = { items: [period_start, Grid], api: { submit: Report.ReadReport }, bbar: pager, tbar: [....] }; //use the config we defined as the initial config for this class Ext.apply(this, Ext.apply(this.initialConfig, config)); //use this function as the initComponent function MyPkg.Ui.Report.superclass.initComponent.call(this); } }); Ext.reg('Report', MyPkg.Ui.Report); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload