ext 单击 如何获取当前行号

ext 单击 如何获取当前行号,第1张

给这个Grid添加一个事件,行单击事件

然后d出提示框

注意:rowIndex 是你grid行的下标索引,并不是真正的行号

而且当你点击第一行 rowIndex 值为空,不是0

所以:rowIndex+1就是你当前的行号了,但是你对grid *** 作的时候

必须要用到下标rowIndex,而且下标要从0开始

一弄好可以了

楼上回答为加过selectModel的情况下并改过select

事件绑定后才适用

通用的方式是

在建GRID时,加listener

new

ExtgridEditorGridPanel({

,

listeners:

{

cellclick

:

function(

Grid,

rowIndex,

columnIndex,e

){//使用cellclick

事件

STOREgetAt(rowIndx);//STORE为你为GRID绑定的store

}

}

})

这样既可

首先给楼主看下我的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>

colNames=$("#UsersGrid")jqGrid('getGridParam','colNames')

colModel=$("#UsersGrid")jqGrid('getGridParam','colModel')

楼主去学下调试工具,firebug或者chrome的开发工具,看结构就知道了

gridgetColumnModel()getColumn(0)setHeader("modified");

其中0是column的index,tbar也是一样的

更新之后要刷新一下

gridgetView()refresh(false);

以上就是关于ext 单击 如何获取当前行号全部的内容,包括:ext 单击 如何获取当前行号、extjs grid中 当单击某一单元格时,可以获得该行的数据记录,该怎么做、EXT GRID 问题 求 过路大神指教 此问题已 为难小弟良久等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存