How to change Primefaces fileupload cancel button icon

为君一笑 提交于 2020-01-06 07:59:28

问题


I want to use jQuery ui-icon-close instead of ui-icon-cancel. So I go to the fileupload.js file in the primefaces jar (3.3.1), change the reference to ui-icon-cancel to ui-icon-close (line#2082, upload template). But it doesn't work. Any idea? Thanks.


回答1:


I found an easier way to solve this problem:

  1. I added an id to my fileupload control:

    <p:fileUpload id="related_file" ..../>
    
  2. Then in my css, I add the following lines:

    div[id*=related_file] .ui-icon-cancel{
        background-position: -96px -128px !important;
    }
    

This works and the cancel button ends up using the ui-icon-closeThick icon.

But I would still like to know why my original approach didn't work if anybody knows the answer. Thanks.



来源:https://stackoverflow.com/questions/13594499/how-to-change-primefaces-fileupload-cancel-button-icon

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!