有人用过extjs 吗,我是新手,在Ext.grid.ColumnModel({}) 怎么获得值,在线等

有人用过extjs 吗,我是新手,在Ext.grid.ColumnModel({}) 怎么获得值,在线等,第1张

ExtgridColumnMode

是个组件  你想获得哪个值  要获取整个组件的函数是

GirdgetColumnModel()

需要绑定值的话 是这样配置   dataIndex : 'dlTime'  dltime 是数组键值

columns: [

        { header: "Ticker",  dataIndex: 'dlTime', width: 60, sortable: true},

     ]

getColumnWidth( Number col ) : Number

返回某个列的宽度。Returns the width for the 

getTotalWidth( Boolean includeHidden ) : Number

返回所有列宽度之和

getColumnHeader( Number col ) : String

返回某个列的头部

在一个gridpanel中添加listeners属性,监听rowclick事件,在这里选择第二个gridpanel对应行

var grid=new ExtgridGridPanel({

  el:'tree',

  cm:cm,

  tbar:['->',btnCoalition2, '', ''],

  store : ds,

  listeners:{

    rowclick:function(grid,rowIndex,e){

grid2getView()refresh();

grid2getSelectionModel()selectRow(rowIndex);//选中

//grid2getView()getRow(rowIndex)stylebackgroundColor = '#87CEFA';设置颜色

    }

  }

});

首先给楼主看下我的Action返回的json数据格式:

{"limit":15,"result":[{"budget":0,"remark":"","documentNum":"","presidentName":"段鑫湖南分公司娄底中心支公司冷水江支公司","structureName":"代理人资格考试培训","oaUserId":"","finishedCount":0,"depId":"HA0","orgId":3212,"id":145407,"sapNum":"","planType":"1","principalId":"H22100723","sapType":"","userId":"","factStartdate":null,"userName":"","presidentId":"duanxin","className":"湖南分公司娄底中心支公司代理人资格考试培训2011年第8期","presidentPeriod":0,"factStuCount":"","stuCount":"5","structureType":"","factEnddate":null,"post":0,"principalName":"李长清","check":0,"status":"0","planId":147165,"workNum":"","period":"201106","orgName":"娄底中心支公司","cost":0,"classNum":"HA0045342","content":"","sap":"","startdate":"2011-06-04 00:00:00","trainCenter":"","periodType":0,"cash":0,"target":"","comId":"H","trainAddress":"","structureId":106,"enddate":"2011-06-05 00:00:00","brief":"","certificateFlag":""}],"totalCount":44548,"start":0,"totalPages":2970}

前台的store:

var classStore = new ExtdataJsonStore( {

root :'result',

totalProperty :'totalCount',

idProperty :'id',

remoteSort :false,

fields : [ 'id', 'classNum', 'className', 'budget', 'stuCount', 'sap',

'orgName','status','startdate','enddate','orgId','planId',

'structureId','content','cost','remark','target','presidentId',

'presidentName','principalId','principalName','factStartdate',

'factEnddate','factStuCount','structureName','comId','depId','sapNum',

'presidentPeriod','periodType'],

proxy :new Extdata>

排版看起来真的有点蛋疼啊,我运行了下,也是一样的问题,原因是你的ExtJs代码未被触发,页面载入后自然找不到对象,一般是把EXTJS写在ExtonReady(function(){})里面的,还有一个小错误是gridrender也是需要有DOM对象的,你的render对象为空的话grid就找不到附着的地方了。我修改了下你的代码如下便可以运行了,希望能帮到楼主。

<head>

<meta >

// 获取 id以 cirelateGrid_ 开头的表格实例

var grids= ExtComponentquery('gridpanel[id^=cirelateGrid_]');

var grid = grids && grids[0];

// 获取grid实例的store对象

var store = grid && gridgetStore();

// 判定store里是否有数据 及判断gird表格对象里是否有数据

var hasData = store && !!storegetCount();

以上就是关于有人用过extjs 吗,我是新手,在Ext.grid.ColumnModel({}) 怎么获得值,在线等全部的内容,包括:有人用过extjs 吗,我是新手,在Ext.grid.ColumnModel({}) 怎么获得值,在线等、ext js 传入行号后grid自动选中、EXT GRID 问题 求 过路大神指教 此问题已 为难小弟良久等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/9547411.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-29
下一篇 2023-04-29

发表评论

登录后才能评论

评论列表(0条)

保存