Telerik Forums
Kendo UI for Angular Forum
2 answers
865 views

Hi , I am using the uploader but I want to limit the number of files that the user can select , the uploader is set to manual uploading and user can select multiple files , so if the user select 7 files and the MaxFileLimit is set to 5,  I want to add 5 files to the list and removed the rest  . 


 <kendo-upload 
                    [saveUrl]="uploadUrl" 
                    [autoUpload]="false" 
                    [actionsLayout]="actionsLayout"
                    [restrictions]="imageRestrictions" 
                    (select)="select($event)"
                    (remove)="remove($event)" 
                    (clear)="clear()"
                    (upload)="uploadEventHandler($event)"
                    (complete)="complete()">
                        <ng-template kendoUploadFileInfoTemplate let-file>
                            <div><img [src]="findPreview(file)" style="height: 50px;"> Name: {{file[0].name}} </div>
                            <div *ngIf="file[0].validationErrors">You cannot upload this file :: {{file[0].validationErrors[0]}}</div>
                          </ng-template>
                    </kendo-upload>

I have tried using the Select Event to remove the file using  e.preventDefault(); but it does stop the process and not files are added to the list if the users select more than 5 files .


 

publicselect(e: SelectEvent): void { const that = this; e.files.forEach((file) => { if (file.extension === '.jpg') { if (this.imageCount < this.maxImageCount) { this.imageCount++ if (!file.validationErrors) { const reader = newFileReader(); reader.onload = function (ev) { const image = { src: ev.target["result"], uid: file.uid, }; that.imagePreviews.unshift(image); }; reader.readAsDataURL(file.rawFile); } }else { e.preventDefault(); } } }); }

Any ideas on how to remove the extra files or limit the number of files the user can select .

Thanks

 

 

 

 

 

 

 

Hernando
Top achievements
Rank 1
Iron
Iron
 answered on 20 Jun 2023
1 answer
184 views
Hi
I have a dashboard with a grid and space is rather tight, and the user wants to see a long list of items, without covering up other parts of the grid.
Is It possible from my sample below

https://stackblitz.com/edit/angular-kggzs9?file=src%2Fapp%2Fapp.component.ts

To always have the kendo-dropdownlist popup always open just below the column header, no matter which row is being edited ?

Here's a sketch of what I'm looking for .. I want the popup to always open right below Product Name.  For PopupSettings there appears to be no "Top" attribute to accomplish this position change. 


 Using chrome dev tools, I can modify the Top attribute to 0 to achieve the desired result.

Thanks

Yanmario
Telerik team
 answered on 20 Jun 2023
1 answer
140 views

I know I need to define a specific style in package.json using:

"@progress/kendo-theme-default": "^6.3.0"

But I like to know if it is possible to target a specific style for a component. So (I realize this is maybe a weird question), component X uses the material theme and component Y the Bootstrap theme.

I am using your NotificationService in an NgRx effect by the way. So I would also be curious if this would be possible.

 

Stoyan
Telerik team
 answered on 16 Jun 2023
1 answer
194 views
I am investigating other product lines, currently I am using PrimeNG, and because of some problems I am testing your Kendo UI Notification component. First my code:


    toast$ = createEffect(() =>
        this.actions$.pipe(
            ofType(CoreActions.Toast),
            filter(({message}) => !!message),
            tap(({message, messageType}) => {
                this.currentNotification?.hide();
                this.currentNotification = this.notificationService.show({
                    content: message,
                    hideAfter: 5000,
                    position: {horizontal: 'right', vertical: 'top'},
                    //animation: {type: 'fade', duration: 400}, //NOTE: Adding an animation unfortunately causes the toast to stack very shortly when using the 'hide()' function..
                    type: {style: messageType, icon: true},
                    closable: false //NOTE: If true the 'hideAfter' property is ignored
                });
            })
        ),
    {dispatch: false} // Because only an action is done, we should not redispatch (that would cause an infinite dispatch loop of toasts)
    );

As you can see, my use case is not having stacked notifications but hiding the previous one if a new one arrives. Imagine the scenario, something is saving, and you want to show 'Saving...' and when saving has finished you present 'Saved!'. Having stacked notifications is weird from this perspective. 

Now the problem is when having an animation, the hiding and showing gives weird behaviour: for a very short time, the previous message shows up below the current and is hidden (flickering). If I disable the animation it works as expected.
Stoyan
Telerik team
 answered on 16 Jun 2023
1 answer
414 views

I want to give my users the ability to reorder / resize the tiles and the layout, save that as a view,  set a default view and then have the option to choose any saved view in the future that auto loads that grid layout.

 

Yanmario
Telerik team
 answered on 16 Jun 2023
0 answers
784 views
Is it possible to change icon for expande/collapse on MaterDetails Grid?
KendoGrid version in ^13.0.0

Before V13 the icon drawed in UI via icon and css "content">. And we are able just overwrite ::before styl.e.on V13 not it is SVG icon and style override not works any more. not found any infomration on this at https://www.telerik.com/kendo-angular-ui/components/grid/master-detail/ documentation.
Levon
Top achievements
Rank 1
Iron
Iron
 asked on 15 Jun 2023
1 answer
148 views
Multiple files will upload if they are all from a single filepath on the users computer, however when files from multiple local paths are selected for upload only the files from the most recently selected filepath will upload. This is all despite the UI window displaying all selected files. Is this a limitation of the component? Or is there something I've missed in the documentation?
Slavena
Telerik team
 answered on 15 Jun 2023
1 answer
330 views

Hi, if we are using Kendo Chart (Angular I believe) on a new project and i need the developers to replicate the example wireframe column chart below.
I have been advised that they can't get the column totals to appear at the top of the columns. Is this possible and if so what do they need to do to get the column totals at the top of the columns using angular?

 

 

Any help would be appreciated.

Regards

Alan

 

Hetali
Telerik team
 answered on 15 Jun 2023
1 answer
168 views

Hi,

I have a service with a http request to an api that returns a Observable<Pendentes[]>.

I need to call the service in my component, but I can't get the pagination working.

I attached some prints of my code.

 

Best regards,
Pedro Marquinhos

Slavena
Telerik team
 answered on 14 Jun 2023
1 answer
379 views

Hello,

I'm using kendo-upload for uploading files and displaying progress by subscribing to the uploadProgress event. 

When [chunkable]="false" it seems that the event is fired every second or less, allowing the developer to show the progress smoothly.

The above is not true when [chunkable] is set to some value, the event is fired only when every next chunk is uploaded. Consider the following settings: [chunkable] = "{ size: 1048576} and file size to upload is 10Mb, in this case, only 10 events are going to be fired with  event.percentComplete = 10, 20, 30 .... 100. This prevents me from building a progress indicator that works smoothly enough. Any ideas about getting uploadProgress fired during the chunk upload more often than once at the end?

Slavena
Telerik team
 answered on 12 Jun 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?