带有 extjs 4.2 的 Filefield,没有 fakepath [英] Filefield with extjs 4.2 without fakepath

查看:17
本文介绍了带有 extjs 4.2 的 Filefield,没有 fakepath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要 extjs 4.2

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'
},

我想要一个附件组件,它显示没有此文本的文件名:c/fakepath

I want to have a attachment component which display name of file without this text : c /fakepath

推荐答案

没有内置的方法来实现这一点,但是,您可以对 fakepath 执行查找/替换并删除.我在 change 事件上实现了这一点.下面是一个例子:

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);
                        }
                    }

我创建了一个 sencha fiddle 演示了一个工作示例

I created a sencha fiddle demonstrating a working example

这篇关于带有 extjs 4.2 的 Filefield,没有 fakepath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆