4 Answers, 1 is accepted
Hi Stefanos,
In general, when tabs are selected, the TabStrip component emits a tabSelect event only, by returning a value from type SelectEvent. Here is an example:
https://stackblitz.com/edit/angular-9xwkfj?file=app/app.component.ts
Let me know if any further questions come up on this case.
Regards,
Martin
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Martin hello,
I apologize that I'm posting here but my support license got expired and I can't renew it right now and I need urgently your help on the documents upload component :/
I am uploading the file like this:
<
kendo-upload
#myUploadElement [(ngModel)]="myModel" [saveUrl]="" [removeUrl]="" [autoUpload]="false" [multiple]="false" [batch]="false"
[restrictions]="UploadRestrictions" (select)="onSelectEvent($event)" (upload)="UploadDocument($event, 1)" (remove)="UploadDocsRemove()">
</
kendo-upload
>
UploadDocument function uploads the file with a post request to an mvc controller, that works just fine, then I send back a response and I am trying to do something like the following: (file name is always red and the class k-file-error is on).
Can you please help me on that and tell how I can mark the file as successfully upload and get that green class color on ??
@ViewChild("myUploadElement") public myUploadElement: UploadComponent;
var httpResponse = new HttpResponse({ status: 200});
var files = this.myUploadElement.fileList.filesFlat;
files[0].state = 3;
var event = new SuccessEvent(files, "upload", httpResponse);
Hi Stefanos,
It seems that the last ticket differs from the initial topic of the thread. To maintain a clean history of your account and provide better support service in general, please avoid opening tickets in threads that aren't related. I see your license is expired, but you can still log your questions in our public forum, where the community could help.
As for the issue, basically, the upload event is used to send headers or any additional data with the item to the server. By default, the Upload always made a request to the [saveUrl] property which sets the URL of the endpoint for the upload request.
Also, I want to mention that the FileSelect component is similar to the Upload, with the only difference that is used only to select files from the file system, leaving the rest of the process in the hands of the developer (the developer needs to decide when and how to send the request to the server, etc.).
It seems that the request to the server is handled manually through the upload() event of the component. Thus even the controller return status 200, the Upload throws an error for an invalid request as the Upload does not know what happens with the file. Also, this might cause the mentioned styling and error/success event issues. If our assumptions are correct there is nothing much that we can do as the requests do not go through the component.
What can I suggest at this point is to use the saveUrl built-in option to upload the files and benefit from the built-in styling of the file status or take a look at our FileSelect component, which allows users to select single or multiple files from their file systems without configuring dedicated server handlers.
Regards,
Martin
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.