It would be great to have a CssClass Property to specify a class for the buttons
I'm currently using this Uploader:
The result is:
I would like to set the button as a e-primary and e-outline
Infact it would be great to have a Template Area for the buttons, so I can Add another button aside the existent
|
|
|
.e-upload .e-file-select-wrap .e-btn {
background-color: transparent;
border-color: #e3165b;
color: #e3165b;
}
.e-upload .e-file-select-wrap .e-btn:hover {
background-color: #e3165b;
border-color: #e3165b;
color: white;
} |
"Yes we can achieve the requirement by overriding the existing button styles . Kindly refer the below styles and sample for your reference. "
I think that's not exactly a solution, the e-primary colors are defined in a scss (sass) file (Theme) I don't want to statically set the colors, I want to use the Css Class already defined.
The template area for the buttons is a suggestion as a solution for the problem, as If I can put my own button and on click method call @ref.Upload or @ref.Clear (would use a Ref to the SfUploader object)
But the template is just a suggestion, setting a CssClass for each button would be more straight forward
|
.e-upload .e-file-select-wrap .e-btn {
background-color: transparent;
border-color: #e3165b;
color: #e3165b;
}
.e-upload .e-file-select-wrap .e-btn:hover {
background-color: #e3165b;
border-color: #e3165b;
color: white;
}
|
|
|
|
<SfUploader ID="UploadFiles" AllowedExtensions="" CssClass="e-outline e-primary" AutoUpload="false">
<UploaderButtons Browse="Importar Dados da Planilha" Upload="Envio" Clear="Claro">
</UploaderButtons>
<UploaderEvents OnRemove="OnFileRemove" ValueChange="OnChange" OnUploadStart="UploadEventHandler"></UploaderEvents>
<UploaderAsyncSettings SaveUrl="" RemoveUrl=""></UploaderAsyncSettings>
</SfUploader>
<style>
.e-upload .e-file-select-wrap .e-btn {
background-color: transparent;
border-color: #e3165b;
color: #e3165b;
}
.e-upload .e-file-select-wrap .e-btn:hover {
background-color: #e3165b;
border-color: #e3165b;
color: white;
}
</style>
@code{
public void clickAction()
{
}
public void OnFileRemove(RemovingEventArgs args)
{
}
public void OnChange(UploadChangeEventArgs args)
{
}
public void UploadEventHandler(UploadingEventArgs args)
{
//This method will get triggered before the file get started to uploaded in the server.You can use it, if you wants to perform any action before uploading the file to server
}
} |