---
title: "Ext.自动适应宽度"
author: "20444465"
date: "2011-07-19T12:04:39Z"
tags: []
categories: ["Web前端"]
slug: "ext"
draft: false
lastmod: "2011-07-19T12:04:39Z"
id: 1127786
url: "https://20444465.iteye.com/blog/1127786"
---

var setting_customfieldslist_grid = new Ext.grid.GridPanel({
        store : _store,
        cm : _cm,
        //在Et.grid.ColumnModel中定义了id属性的那一列 
        //也可以用索引：autoExpandColumn:3，其中的3表示的是列的索引
        <span style="color:red">autoExpandColumn : 'BCNames_id'</span>
    });
var _cm = new Ext.grid.ColumnModel({
    header : "ID",
    dataIndex : 'ID',
    hidden : true,
    width : 100,
    autoHeight : true
}, {
    header : "品类类别名称",
    dataIndex : 'BCNames',
    id : 'BCNames_id',
    width : 200
});