惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
The Cloudflare Blog
IT之家
IT之家
V
V2EX
雷峰网
雷峰网
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
小众软件
小众软件
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
A
About on SuperTechFans
B
Blog
月光博客
月光博客
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI

博客园 - 白沙河

axure 用中继器实现下拉多选框 excel 常用全局变量 win10 x64 python3.6 pycharm 安装statsmodels Oracle 10进制转36进制 概念数据模型设计与逻辑数据模型设计、物理数据模型设计的关系 does not support ASP.NET compatibility 错误 Oracle日志文件管理与查看 oradmin相关用法 Oracle Standby Database 实现方案 c# 调用zebra打印指令 打印到USB端口 win2008 64位 + oracle11G 64位 IIS7.5 配置WEBSERVICE VISIO 2007 修改形状默认字体 自定义模具 c# 解决IIS写Excel的权限问题 vs2008 连接 vss2005 出现 analyze utility 错误的解决方法 WPF CANVAS 内形状的margin为负值时定位不正确的问题 韶关旅游攻略 extjs 文件上传对话框显示后,页面出现空白的问题 IE8不能上网的问题 一些事件的评论
EXTJS gridpanel 动态设置表头
白沙河 · 2013-04-02 · via 博客园 - 白沙河

EXTJS gridpanel 动态设置表头,用reconfigure方法

var col = "([{ text :'Company', flex : 1, sortable : false, dataIndex:'company'},{ text:'Stock Price', columns:[{ text :'Price', width : 75, sortable : true, dataIndex:'price'},{ text :'Change', width : 75, sortable : true, dataIndex:'change'},{ text :'% Change', width : 75, sortable : true, dataIndex:'pctChange'}]},{ text :'Last Updated', width : 85, sortable : true, dataIndex:'lastChange'}])";
        var cols = eval(col);
        // Ext.findCmp('testgrid', this).columns.add(cols);
        //var grid = Ext.getCmp('testgrid'); //Ext.findCmp('testgrid', this).columns;

         Ext.findCmp('testgrid', this).reconfigure(null, cols);

       //findCmp是自定义根据类id查找控件id的方法

以下是EXTJS api说明

reconfigure( [Ext.data.Store store], [Object[] columns] )

Reconfigures the table with a new store/columns. Either the store or the columns can be ommitted if you don't wish to change them.

Parameters

  • store : Ext.data.Store (optional)

    The new store.

  • columns : Object[] (optional)

    An array of column configs