求教高手 如何在EXTJS的grid的行内添加button

tyk315 2011-07-17 10:27:41
如图
像最右边一样在行内添加button
并能实现单击删除或编辑的功能
...全文
379 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wsdydmw 2011-08-06
  • 打赏
  • 举报
回复
3楼的正解
dpj_1980 2011-08-05
  • 打赏
  • 举报
回复
header : "",dataIndex : 'id',width : 25,renderer:function(value){
return String.format("<input type='button' style='height:20px;' onclick='campaignManage.customFieldItemManage()' value='按钮' />");
}
这样应该可以清楚吧
豆虫 2011-07-18
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lsw645645645 的回复:]

设置renderer
JScript code

Ext.onReady(function () {
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{ id: 'company', h……
[/Quote]
什么renderer.....八杆子打不着

那个东西是一个Action组件 要写在store grid cm中
tyk315 2011-07-17
  • 打赏
  • 举报
回复
多谢。我去试下~
lsw645645645 2011-07-17
  • 打赏
  • 举报
回复
设置renderer

Ext.onReady(function () {
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{ id: 'company', header: 'Company', width: 160, sortable: true, dataIndex: 'company' },
{ header: 'Price', width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price' },
{ header: 'Change', width: 75, sortable: true, renderer: change, dataIndex: 'change' },
{ header: '% Change', width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange' },
{ header: 'Last Updated', width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange' },
{ header: 'action', width: 85, sortable: false, renderer: function (val) { return '<input type="button" value="toto" id="' + val + '"/>'; }, dataIndex: 'somefieldofyourstore' }


],
stripeRows: true,
autoExpandColumn: 'company',
height: 350,
width: 600,
title: 'Array Grid',
// config options for stateful behavior
stateful: true,
stateId: 'grid'
});

});
tyk315 2011-07-17
  • 打赏
  • 举报
回复
版本是3.4
豆虫 2011-07-17
  • 打赏
  • 举报
回复
用的Ext的版本是多少?

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧