2012-09-03 65 views
0

可以通过文件上传来制作GridPanel。带文件上传的ExtJS 4网格

我想让GridPanel有一些文本列和一列来上传文件。

dataIndex:'fieldForFile', 
editor: { 
    xtype:'filefield' 
} 

的作品,但当我选择一个文件和渲染器消失,记录值为空。

下一步是上传网格中选择的文件,此刻我不知道该怎么做。

任何人都可以帮助我吗?

问候, 帕维尔

回答

2
xtype:'actioncolumn', 
width: 30, 
text: '^', 
align: 'center', 
items: [{ 
    icon: '/Content/images/upload.png', // Use a URL in the icon config 
    tooltip: 'Upload', 
    handler: function(grid, rowIndex, colIndex) { 
      var uploadField = Ext.getCmp('uploadField'); 
      uploadField.fileInputEl.dom.click(); 
    } 
}]