This is a migrated thread and some comments may be shown as answers.

Kendo TabStrip OnClose Event

4 Answers 305 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
n/a asked on 28 Apr 2020, 09:14 AM

Hello,

I need an on close event of each tab in a tabstrip component in Angular typescript.

How can we achieve that please ??

Thanks

4 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 29 Apr 2020, 12:23 PM

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
n/a
Top achievements
Rank 1
answered on 30 Apr 2020, 12:06 PM
I know that Martin, anyway thanks.
0
n/a
Top achievements
Rank 1
answered on 11 Nov 2020, 11:59 AM

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);
0
Martin
Telerik team
answered on 13 Nov 2020, 07:37 AM

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/.

Tags
General Discussions
Asked by
n/a
Top achievements
Rank 1
Answers by
Martin
Telerik team
n/a
Top achievements
Rank 1
Share this question
or