11
A
回答
4
你应该使用一个自定义渲染,但我建议你使用一个工具栏按钮,而不是更干净。
如果您想要更多参考,请参阅ColumnModel类的documentation。
无论如何,它会给类似的东西
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'
});
这个片段是this sample的提取物。
对于工具栏方式,我建议你,只需在GridPanel的工具栏中添加一个按钮,然后钩住SelectionModel,以便在用户不选择任何行时禁用这些按钮。
6
Actualy Ext.Buttons in a row cell is as as i can tell tell impossible with the current setup of Ext。当然,实际上可以在单元格的div中呈现按钮的HTML,但我实际上认为这是一个坏主意。
更好的方法是实现Saki的rowactions插件,这使得向每行添加按钮/操作变得非常简单。
7
0
我要一个额外的答案添加到这个问题,因为,因为这问题已发布我已经创造了ExtJS的网格组件,它允许按钮被添加到网格列的延伸。
https://github.com/Inventis/Ext.ux.grid.ButtonColumn
要知道,呈现大量行的时候它可能会影响到对旧/较慢的系统性能。
2
ü也可以尝试在网格这里添加按钮图像此代码代码:
new Ext.grid.ColumnModel([ {
xtype : 'actioncolumn',
header : "Action",
items : [ {
icon : '../images/enable.png',
tooltip : 'Enable App',
width : 50,
id:'enableAppId',
handler : function(grid, rowIndex) {
//add code for button click
}
}]
} ]
)
我也用这个使该行数据
相关问题
- 1. 如何在ExtJS中添加图像按钮的网格
- 2. ExtJS 3.4在网格底部添加按钮
- 3. 在网格中添加按钮
- 4. 在网格上添加按钮
- 5. 添加按钮到网站
- 6. Extjs将事件添加到网格形式的按钮控制器
- 7. 在yii2中添加一个按钮到网格视图
- 8. 在extJs中添加按钮到HTML编辑器
- 9. 如何在Extjs网格标题菜单上添加额外按钮
- 10. 添加一个按钮,网格动态
- 11. ExtJS 4动态添加按钮
- 12. ExtJS网格单元格中的分割按钮
- 13. 添加Like按钮到我的网站
- 14. 在剑道网格中连续添加按钮
- 15. 添加一个按钮来改变在babylon.js中的网格
- 16. 将按钮添加到表格脚注
- 17. 使用按钮添加新行到asp .net网格视图使用按钮
- 18. 如何使用添加新按钮在w2ui网格中添加新项目?
- 19. 如何动态添加按钮到SilverLight数据网格
- 20. 将按钮添加到WPF数据网格
- 21. 将几种样式添加到Kendo网格按钮
- 22. 如何在extjs的动作列中添加一个按钮
- 23. 添加按钮在EXTjs中动态点击事件4
- 24. ExtJS 4网格添加新记录后更新网格
- 25. ExtJs 4参考网格中的工具栏按钮
- 26. 如何正确应用网格extjs中的单选按钮?
- 27. 在wordpress网站添加RSS按钮
- 28. 如何在网格页脚中添加总行数extjs
- 29. extjs 3 - 在属性网格中添加进度条和图像
- 30. 在MFMessageComposeViewController中添加按钮
接受一个答案。 – 2012-12-27 09:50:42