Use the FileUploadField plug-in of Extjs to upload files. Because FileUploadField is the extension plug-in of ext, the method cannot be found in its api. This file is in the ux In the examples folder of extjs, therefore, FileUploadField must be introduced before it can be used. during use, two upload buttons are displayed on the page, this is related to the css style of ext, so you need to modify the style:
Copy codeThe Code is as follows:
<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>
In this case, the plug-in can be used normally.