使用Extjs的FileUploadField插件上传文件,因为FileUploadField是ext的拓展插件所以在其api中是找不到其方法的,这个文件在extjs的examples文件夹下的ux中,所以在使用FileUploadField的时候必须将其引入过来才可以使用,在使用的过程中会出现一个问题就是,在页面中出现了两个上传按钮,这个是和ext的本身css的样式有关系,所以要将样式修改下:

复制代码 代码如下:

<style type=text/css> .upload-icon {
background: url('images/image_add.png') no-repeat 0 0 !important;
}
.x-form-file-wrap {
position: relative;
height: 22px;
}
.x-form-file-wrap .x-form-file {
position: absolute;
right: 0;
-moz-opacity: 0;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
height: 22px;
}
.x-form-file-wrap .x-form-file-btn {
position: absolute;
right: 0;
z-index: 1;
}
.x-form-file-wrap .x-form-file-text {
position: absolute;
left: 0;
z-index: 3;
color: #777;
}
</style>

这个时候插件的使用才会正常。

点赞(55)

评论列表共有 0 条评论

立即
投稿
返回
顶部