Telerik Forums
Kendo UI for Angular Forum
1 answer
361 views

Right now I created a separate grid but I would like to have the list of attachments part of the file upload control if possible. How do I iterate through a collection and bind the filename, download link, remove etc..  inside the upload control ? 

 

the way I do it now is simply

<div>
        <ul>
            <li *ngFor=" let a of attachments">
                {{a.name}}
                <button type="button" (click)="download(a)">download</button>
                <button type="button" (click)="deleteAttachment(a)">delete</button>
            </li>
        </ul>
    </div>

 

Slavena
Telerik team
 answered on 12 Oct 2021
1 answer
1.0K+ views

Hi,

I have a grid with this config:

<kendo-grid
    [kendoGridBinding]="gridData.data"
    [filterable]="true"
    (add)="addHandler()"
  >

In this grid I have a checkbox column:


<kendo-grid-column field="defaultLang" title="Alapértelmezett">
      <ng-template kendoGridCellTemplate let-dataItem>
        <div style="text-align: center">
          <input type="checkbox" disabled [checked]="dataItem.defaultLang" />
        </div>
      </ng-template>
    </kendo-grid-column>

If I want to filter this column I get an error, because the filter mechanism operates on strings. How can I

make this work, that I can filter it with '0', '1', 'true', 'false'?

 

Thanks.

Martin Bechev
Telerik team
 answered on 12 Oct 2021
1 answer
793 views

Hi everyone, I'm currently working on a grid which is dynamically built and I'm experiencing some weird behaviour.

I'll try to do my best to explain it clearly, starting from the code of the grid:

<kendo-grid
        [kendoGridBinding]="kgData"
        [sortable]="true"
        [pageable]="true"
        [pageSize]="5"
        >
        <!-- BUTTONS -->
        <ng-template kendoGridToolbarTemplate>
          <button kendoGridAddCommand>Aggiungi record</button>
          <button class="k-button">
            Salva
          </button>
        </ng-template>
        <!-- HEADERS -->
        <kendo-grid-column *ngFor="let col of columnInfoArray" [field]="col.fieldname" [title]="col.description" [hidden]="col.fieldname === 'id'">
          <ng-template
            kendoGridCellTemplate
            let-dataItem>
              <!--! NUMBER  -->
              <!--
                decimals: do not allow the user to type , and . when focused
                format n0: do not put commas when the input is not focused
              -->
              <kendo-numerictextbox
                *ngIf="col.configtype === 'int'"
                kendoGridFocusable
                [decimals]="0"
                format="n0"
                [value]="dataItem[col.fieldname]"
                (valueChange)="kgUpdateValue(col.fieldname,dataItem,$event)"
                ></kendo-numerictextbox>
              <!--! SELECT  -->
              <!--
                [data]: the array of options, textField and valueField access the properties of the objects contained inside the array
                [value]: gets the default value based on the fieldname and the value
              -->
              <kendo-dropdownlist
                *ngIf="col.configtype === 'combo'"
                kendoGridFocusable
                [data]='kgSelectOptions[col.fieldname]'
                textField='label'
                valueField='value'
                [value]='kgGetDefaultOption(col.fieldname,dataItem[col.fieldname])'
                (valueChange)="kgUpdateValue(col.fieldname,dataItem,$event.value)"
                ></kendo-dropdownlist>
              <!--! CHECKBOX  -->
              <input
                *ngIf="col.configtype === 'bool'"
                kendoGridFocusable
                type="checkbox"
                kendoCheckBox
                (change)="kgUpdateValueEvent(col.fieldname,dataItem,$event)"
                />
              <!--! STRING  -->
              <input
                *ngIf="col.configtype === 'string'"
                kendoGridFocusable
                (change)="kgUpdateValueEvent(col.fieldname,dataItem,$event)"/>
          </ng-template>
        </kendo-grid-column>
      </kendo-grid>


columnInfoArray is an array of objects like this: (of course with different values every time) 

{
idfield: 1,
description: "Widget",
fieldname: "idwidget",
mandatory: true,
actionget: "widget",
configtype: "combo",
deleted: false,
filter: false
}

This tells the code the "type" of input I'm expecting, like a select box, a number, a textarea, a checkbox etc etc.
NOTE: despite I'm talking about inputs, the table isn't inside any form and forms aren't needed to get the job done.
The actionget, when present, is just a string that will be concatenated to a link and it'll get an array of objects that will look like:

{
   label: 'Some text',
   value: 1
}

There are two things that I don't understand
  1. inside the kendo-dropdownlist you can see the function kgGetDefaultOption. Inside this function I have put a console.log of a counter that starts from 0 and gets incresed every time the function is called: my kgData consists of 7 records, and I have two columns with configtype == 'combo'. I was expecting for the counter to be 14, but I get 89 instead. Also, the function is called every time I change page on the pagination bar. Why does that happen?
  2. if I check the checkbox on row 1 of page 1, every checkbox on row1 of other pages is checked as well (I'm providing a GIF that shows what I mean)

 

Unfortunately I can't provide a StackBlitz (the API calls that get the data don't work on it). I hope this is enough for you to help me, else I will provide more info.

PS: even if that esulates from the main question, if you think something can be improved for what I need, let me know! This is the very first time I'm using Kendo grid and to be honest I found the documentation really difficult to understand so I might've missed something.



Martin Bechev
Telerik team
 answered on 12 Oct 2021
1 answer
205 views

Hello,

Is there a way to display a tooltip in the dropdown button dropdown items?

thanks!

B

Hetali
Telerik team
 answered on 11 Oct 2021
1 answer
114 views

I am trying to apply formatting to the excel cells (both data cells and footer cells) using the cellOptions, footerCellOptions and groupFooterCellOptions. Although the formatting works fine with dataCells, it doesn't gets applied to footerCells.

In my project we have complex template for the footer, I thought that might be the reason its not working, but I created a simple sample project to show what I am trying to achieve.

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

https://angular-qarfdv.stackblitz.io

it can be seen here that the dataCells having negative values are getting formatted, but footerCells are not

Although the formula does gets applied, but it shows an error in the cell. ( if you double click on the cell and click out it gets applied)

Appreciate your help

Martin Bechev
Telerik team
 answered on 11 Oct 2021
2 answers
1.2K+ views
conditional formatting of cells in kendo grid export to excel
Martin Bechev
Telerik team
 answered on 11 Oct 2021
1 answer
168 views
Is there a way to hide the input boxes in the datepicker and timepicker? I am trying to just make use of the popups and no show the inputs.
Ivo
Telerik team
 answered on 11 Oct 2021
1 answer
178 views

We are not able to get the formdata values in web api 2.0 (Not .NET Code).  In the http Interceptor we are passing authorization token along with files.  Is there any sample that you have to WebApi 2.0 Upload examples? 

Request Capture in Browser

------WebKitFormBoundary6Jvam5nqf7nxkSh5 Content-Disposition: form-data; name="file"; filename="folderaccesserror.PNG" Content-Type: image/png ------WebKitFormBoundary6Jvam5nqf7nxkSh5 Content-Disposition: form-data; name="documentVersionId" 123 ------WebKitFormBoundary6Jvam5nqf7nxkSh5 Content-Disposition: form-data; name="data" {"RemoteId":"10000","UserId":"so","Page":"UploadFiles","Event":"uploadEventHandler","ActionType":"S","UserName":""} ------WebKitFormBoundary6Jvam5nqf7nxkSh5--

 
Martin Bechev
Telerik team
 answered on 08 Oct 2021
2 answers
226 views

Hello,

I want to stretch the textarea to it's full parent height, without the dragable reziser and the parent is a flexbox.
What is the best way to achive it? Do I have to edit the underlying textarea css?

 

Setting the kendo-textarea to `flex: 1` stretches only the kendo element not the textarea inside.

Example: stackblitz

 

EDIT: Scribble for better understanding

Stoyan
Telerik team
 answered on 08 Oct 2021
1 answer
147 views

We currently in the process of upgrading from kendo UI for jquery to kendo UI for Angular. We have an option for or current girds to allow the user to save how they have arranged the grid and any filters they are using the grid. We do this using the grid functions getOptions and setOptions. I have noticed that these functions do not seem to work for the new Angular grids. Is there a similar function that might work?

Yanmario
Telerik team
 answered on 08 Oct 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?