是否可以在 extjs 3 的属性网格中实现进度条?如何在属性网格中添加图像?
我有一个百分比值,我想在进度条中表示该值(不可编辑)。
非常感谢您的帮助。
最佳答案
你可以尝试这样的事情:
//==== Progress bar 1 ====
var pbar1 = new Ext.ProgressBar({
id:'pbar1',
width:300
});
var grid = new Ext.grid.PropertyGrid({
title: 'Properties Grid',
autoHeight: true,
width: 300,
renderTo: 'grid-ct',
bbar: pbar1, //You can set the progress bar as the property girds bottom toolbar.
customRenderers: {
Available: function(v){
return '<img src="path to image" />';
}
}, //This would render the image into the Available property.
source: {
"(name)": "My Object",
"Created": new Date(Date.parse('10/15/2006')),
"Available": false,
"Version": .01,
"Description": "A test object"
}
});
使用customRenderers渲染图像时
渲染器类型的名称应与其将渲染的属性的名称相对应
有关更多信息,请参阅 API .
关于extjs 3 - 在属性网格中添加进度条和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5973259/