Filefield与extjs 4.2没有fakepath [英] Filefield with extjs 4.2 without fakepath
本文介绍了Filefield与extjs 4.2没有fakepath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在附件中使用这个组件:
{
pre>
xtype:'filefield',
id:'file6',
fieldLabel:'test',
labelWidth:100,
msgTarget:'一边',
allowBlank:false,
anchor:'100%',
buttonText:'upload'
},
我想拥有一个附件组件,显示没有此文本的文件名称:
c / fakepath解决方案没有一种内置的方法来完成这一点,但是您可以对fakepath进行查找/替换并删除。我在
更改
事件中推动了这一点。这是一个例子:监听器:{
change:function(fld,value){
var newValue = value.replace(/ C:\\fakepath\\ / g,'');
fld.setRawValue(newValue);
}
}
我创建了一个 sencha fiddle 演示一个工作示例
I want with extjs 4.2
I use this component in attachment :
{ xtype: 'filefield', id: 'file6', fieldLabel: 'test ', labelWidth: 100, msgTarget: 'side', allowBlank : false, anchor: '100%', buttonText: 'upload' },
I want to have a attachment component which display name of file without this text : c /fakepath
解决方案There isn't a built-in way to accomplish this however, you can do a find/replace for fakepath and remove. I impelmented this on the
change
event. Here is an example:listeners: { change: function(fld, value) { var newValue = value.replace(/C:\\fakepath\\/g, ''); fld.setRawValue(newValue); } }
I created a sencha fiddle demonstrating a working example
这篇关于Filefield与extjs 4.2没有fakepath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文