admin管理员组文章数量:1416631
I have a dxFileUploader:
<div data-bind="dxFileUploader: { buttonText: 'Select file', labelText: 'Drop file here', accept: 'image/*' }"></div>
On the UI I got a surrounding white area (div).
How to get rid of it? I need only a simple button with an icon and no text that looks like this:
<div data-bind="dxButton: { icon: 'arrowup' }"></div>
I have a dxFileUploader:
<div data-bind="dxFileUploader: { buttonText: 'Select file', labelText: 'Drop file here', accept: 'image/*' }"></div>
On the UI I got a surrounding white area (div).
How to get rid of it? I need only a simple button with an icon and no text that looks like this:
<div data-bind="dxButton: { icon: 'arrowup' }"></div>
Share
Improve this question
edited Feb 18, 2015 at 11:33
user2005634
asked Feb 18, 2015 at 11:17
user2005634user2005634
1995 silver badges13 bronze badges
3 Answers
Reset to default 2Use following styling for your file uploader
.dx-fileuploader,
.dx-fileuploader * {
display: inline-block;
margin: 0;
vertical-align: middle;
}
.dx-fileuploader-input-container {
display: none;
}
.dx-fileuploader-wrapper,
.dx-fileuploader-input-wrapper{
padding: 0;
border: none;
}
To set icon to the button do following
$("#fileUploader").find(".dx-button").dxButton("option", "icon", "arrowup");
If you also need to hide selected files information add one more css rule
.dx-fileuploader-files-container {
display: none;
}
See the fiddle http://jsfiddle/tabalinas/uf5vzgdw/
Simply just set [showFileList]="false"
ex:
<dx-file-uploader
selectButtonText="Select File..."
[showFileList]="false"
labelText
accept="image/*"
uploadMode="useForm">
</dx-file-uploader>
you can hack with fontawesome in
onContentReady = e => {
const node = document.createElement('I');
node.className = 'cstm-icon fas fa-upload'
document.querySelector('.uploader-container .dx-button-text').appendChild(node);
}
and add some css
本文标签: javascriptHow to configure dxFileUploader to show up like a simple buttonStack Overflow
版权声明:本文标题:javascript - How to configure dxFileUploader to show up like a simple button? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745256536a2650137.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论