社区
Java EE
帖子详情
Ext中向Ext.grid.GridPanel() 添加按钮和点击事件
grjs2004
2013-02-28 12:04:03
如何向EXTJS的Ext.grid.Panel()的列添加按钮,并添加点击事件,可以取出所点击行的所有列的值?
谢谢啦!
...全文
1677
3
打赏
收藏
Ext中向Ext.grid.GridPanel() 添加按钮和点击事件
如何向EXTJS的Ext.grid.Panel()的列添加按钮,并添加点击事件,可以取出所点击行的所有列的值? 谢谢啦!
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
a_b_a_b_a_b_a_b
2013-02-28
打赏
举报
回复
同意楼上的方法,楼上是通用的方法;如何想添加按钮的话是否用renderer方法,返回一个按钮不知道是否可行,没试过;
求知路漫漫
2013-02-28
打赏
举报
回复
给你个例子看吧
Ext.create('Ext.data.Store', {
storeId:'employeeStore',
fields:['firstname', 'lastname', 'senority', 'dep', 'hired'],
data:[
{firstname:"Michael", lastname:"Scott"},
{firstname:"Dwight", lastname:"Schrute"},
{firstname:"Jim", lastname:"Halpert"},
{firstname:"Kevin", lastname:"Malone"},
{firstname:"Angela", lastname:"Martin"}
]
});
Ext.create('Ext.grid.Panel', {
title: 'Action Column Demo',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{text: 'First Name', dataIndex:'firstname'},
{text: 'Last Name', dataIndex:'lastname'},
{
xtype:'actioncolumn',
width:50,
items: [{
icon: 'images/edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('firstname'));
}
},{
icon: 'images/delete.png',
tooltip: 'Delete',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Terminate " + rec.get('firstname'));
}
}]
}
],
width: 250,
renderTo: Ext.getBody()
});
求知路漫漫
2013-02-28
打赏
举报
回复
我以前写过 添加图片,然后添加图片的点击事件,如何获取所有的列需要你在创建页面的时候给图片一个值。 代码具体怎么写忘的差不多了,等下班回去找找给你说下。
Ext
.
grid
.
Grid
Panel
删除线
Ext
.
grid
.
Grid
Panel
删除线 放到example文件夹下运行
Grid
Panel
中的单元格不能选中复制的解决方法
Ext
.
grid
.
Grid
Panel
有一个重大缺陷,就是单元格的内容不能选中,没法选中就没法复制,给用户带来很多不便,下面是从网上搜到的解决方案。
Ext
Js选中var editor = new
Ext
.ux.
grid
.RowEditor详解
Ext
Js选中var editor = new
Ext
.ux.
grid
.RowEditor详解.txt
ext
js单元格合并
ext
js单元格合并,
grid
panel
中多行合并
Ext
Grid
Panel
中实现加链接操作
Ext
Grid
Panel
中实现加链接操作
Ext
Grid
Panel
中实现加链接操作
Ext
Grid
Panel
中实现加链接操作
Java EE
67,550
社区成员
225,864
社区内容
发帖
与我相关
我的任务
Java EE
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
复制链接
扫一扫
分享
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章