Telerik Forums
Kendo UI for Angular Forum
0 answers
94 views

I use a kendo-grid component that has a dynamic list,. When I press Add it adds a new row and each row can be removed from the list. My problem is when I remove an item, it always removes the last row from UI. I saw that the values are correct, only the UI is the problem because it removes the last element from the list and it keeps visible the one I selected to remove.

After some debugging, I saw that it is because of the filteredPermission list that updates at every changes but I do not know how to fix th problem.

Thank you!

  <kendo-grid [data]="rowsPermissionsArray.controls">
        <kendo-grid-column field="id" title="{{ resourceCodes.permissions | translate }}">
          <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
            <kendo-formfield>
              <app-crm-single-dropdown
                class="dl-with-remove-btn"
                [data]="filteredPermissions"
                [formControl]="dataItem.get('id')"></app-crm-single-dropdown>
            </kendo-formfield>
            <ng-container
              *ngFor="let error of form.get('rowsPermissions')?.get(rowIndex.toString())?.get('id')?.errors | keyvalue">
              <kendo-formerror
                *ngIf="
                  error.key === 'required' || error.key === 'duplicatePermission'
                    ? form.get('rowsPermissions')?.get(rowIndex.toString())?.get('id')?.touched
                    : true
                "
                >{{ error.value }}</kendo-formerror
              >
            </ng-container>
          </ng-template>
        </kendo-grid-column>
        <kendo-grid-column [width]="130" title="{{ resourceCodes.actions | translate }}" class="column-action-buttons">
          <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
            <button class="button-grid-action" (click)="showDeleteConfirmationPermissionModal(rowIndex)">
              <icon-delete class="icon"></icon-delete>
            </button>
          </ng-template>
       

</kendo-grid-column>

 get rowsPermissionsArray() {
    return this.form.get('rowsPermissions') as FormArray;

  }

 

  confirmPermissionDeletion = (): void => {
    this.rowsPermissionsArray.removeAt(this.selectedPermissionId);
    this.showConfirmationPermissionModal = false;
  };
  showDeleteConfirmationPermissionModal(id: number) {
    this.selectedPermissionId = id;
    this.showConfirmationPermissionModal = true;
  }
  onCloseConfirmationPermissionModal(): void {
    this.showConfirmationPermissionModal = false;

  }

 

  setupPermissions() {
    this.form.get('rowsPermissions')?.valueChanges.subscribe((selectedValues: any[]) => {
      this.filteredPermissions = this.platformPermissions.filter(
        permission => !selectedValues.some(selected => selected.id === permission.id)
      );
    });
  }

</kendo-grid>

Andreea
Top achievements
Rank 1
Iron
 updated question on 13 Nov 2024
0 answers
40 views

Hello,

Im using angular 16 and .net core 7 version. When i send request to back-end, i can handle. But i have a problem.

Let's assume we have two tables: roles and users. In Angular, there's a grid where I display the roles. I'm having issues on the backend side when applying filtering in that grid.

 <kendo-grid-column [width]="300" title="Rol" [sortable]="cantFilterandSort" field="Roles">
            <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
                <kendo-multiselect [checkboxes]="true" [autoClose]="false" [tagMapper]="tagMapper"
                    [data]="this.roleList" textField="name" valueField="idx"
                    [valuePrimitive]="true"  (valueChange)="onRoleFilterChange($event)"></kendo-multiselect>
            </ng-template>
        </kendo-grid-column>

onRoleFilterChange(selectedRoles: any[]): void {
    this.state.filter = {
      logic: 'and',
      filters: selectedRoles.map(role => ({
          field: 'Roles',
          operator: 'eq',
          value: role
      }))
  };
    this.getAllData();
  }

The request is reaching the back-end.

[HttpPost]
public async Task<IActionResult> GetAllUser([DataSourceRequest] DataSourceRequest filter)
{
    var result = await this.userService.GetAllUser(filter);
    return CreateActionResultInstance(result);
}
public async Task<DataSourceResult> GetAllUser(DataSourceRequest filter)
{

    var result = await entity
          .AsNoTracking()
          .IgnoreQueryFilters()
          .Include(y => y.Roles)
          .Select(x => new UserViewModel
          {
              Idx = x.Idx,
              Email = x.Email,
              Name = x.Name,
              Phone = x.Phone,
              Surname = x.Surname,
              UserName = x.UserName,
              Roles = x.Roles.Select(x => x.Idx)
          }).ToDataSourceResultAsync(filter);
    return result;}

What I need here is for the filtering to work when a role is selected as a filter in the user list on the screen. How can we use a many-to-many table in this case? I researched a lot but couldn't find anything online.

As a note, the IDs of the roles are of type GUID.

Thanks :)

Ingenico
Top achievements
Rank 1
 asked on 20 Aug 2024
0 answers
80 views

In Angular Grid Grouping, Do we have the ability to display a row with multiple columns instead of a specific field?
For Ex: 
https://www.telerik.com/kendo-angular-ui/components/grid/grouping/basics/
Instead of adding a specific field that we group by, Could we add a row with multiple columns?

Additionally, is there a way to achieve a hierarchical view within the grid itself? Similar to the Master Detail functionality, we'd like to have sub-rows that share the same columns as the main row, but without treating them as separate components with distinct headers.
https://www.telerik.com/kendo-angular-ui/components/grid/master-detail/#:~:text=To%20apply%20a%20hierarchical%20order%20to%20the%20desired,are%20filtered%20by%20the%20parent%20key%20field%20value.


Aya
Top achievements
Rank 1
 asked on 13 Aug 2024
0 answers
92 views

Hi,

I used the kendo ui angular for  tilelayout to create a dashboard but i am not able to remove or add the tiles as there is no delete or add icon in the tiles.  So currently drag and  drop of the tiles are happening but not able to remove the tile from the dashboard.
can you please help me?

I am building the application using Angular.

Kendo
Top achievements
Rank 1
 updated question on 23 Apr 2024
0 answers
100 views

Hi, 

I'm using kendo grid in angular. I'm trying to hide/remove the total cell from the kendo grid using *ngIf, but only content inside the cell is hiding, empty cell is showing.



How to hide the total cell from the grid,

This is the code , I have used

<kendo-grid id="antibiotic-result-view" [data]="uniqAntibioticList" [resizable]="false">
    <kendo-grid-column field="Expansion" [width]="150">
        <ng-template kendoGridHeaderTemplate let-column let-columnIndex="columnIndex">
            <div class="antibiotic-heading">{{"Antibiotic" | translate}}
                <mat-checkbox type="checkbox" [ngModel]="allCompleted" disabled="true"></mat-checkbox>
            </div>
        </ng-template>
        <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
            <div *ngIf="dataItem.IsSuppressed">
                <span>{{ dataItem.Expansion }}</span>
                <mat-checkbox type="checkbox" [ngModel]="dataItem.IsSuppressed" disabled="true"></mat-checkbox>
            </div>
        </ng-template>
    </kendo-grid-column>
</kendo-grid>

I have been trying for past 2 days, could someone help me on this ?

Kathiravan
Top achievements
Rank 1
 asked on 22 Mar 2024
2 answers
1.1K+ views

I would like to prevent the grid cells from wrapping and increasing the row height.

Instead I just want the text to be cut off and ending with ellipsis. I tried styling with column classes "white-space: nowrap", but that does not work.

Is that possible?

 

Thank you!

Zornitsa
Telerik team
 answered on 27 Feb 2024
0 answers
86 views

Hello, 

I have a multi-week view scheduler, in which i use the kendo kendoSchedulerGroupHeaderTemplate directive to style my groups according to some resources. 

I want to impose a max-width on this, in order to make sure that the names of the groups are within proportion. (See example: Too-long.png)

 

I have my html code: 

<ng-template kendoSchedulerGroupHeaderTemplate let-resource="resource">
  <div class="group-header-wrapper">
    <div class="group-header-main">{{ resource.text }}</div>
    <div class="group-header-alt">{{ resource.line }}</div>
  </div>      
</ng-template>

and my css: 


.group-header-wrapper {
  //code
}

.group-header-main {
  width: 100%;
  text-align: left;
  background-color: $secondary-color;
  padding: 2px 4px;
}

.group-header-alt {
  width: 100%;
  text-align: left;
  color: white;
  padding: 2px 4px;
}

adding max-width to group-header-wrapper. doesn't fix this. Because the event become unaligned. (see example: unaligned.png)

How can I style this so the events are aligned with their respective slots and days?

Thanks,

Govert Jaap

 

Govert Jaap
Top achievements
Rank 1
 asked on 17 Oct 2023
0 answers
91 views

All thes days the ui of it is fine as we can see in document but now the grid ui is not proper .Is there any modification/update?Tried multiple ways but still i could't resolve.Pfa any suggestion would be great.

 "@progress/kendo-angular-grid": "^5.0.2", this is version being used

Ramya
Top achievements
Rank 1
 updated question on 01 Aug 2023
1 answer
314 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
80 views
Hi,
I'm using kendo but have an issue as follows:

Case 1: The old source can be edited, but the excel is missing data
https://stackblitz.com/edit/angular-v6xzlw-cs7bsp?file=src%2Fapp%2Fapp.component.ts

Case 2: New source can't edit but export excel enough data
https://stackblitz.com/edit/angular-v6xzlw-fpo6xw?file=src%2Fapp%2Fapp.component.ts

Expect: Both can be edited and exported

Anyone who has encountered this case, please support me.

Thanks, all.May be an image of text that says 'x Export Excel Name Name 1 Number AB 001255* AV= 66000000 Case2 Base Revenue 100001 Ratio Name3 100002 196507 90740000005 AB 10000000 Name Base Revenue 100003 0.27390444 Ratio Name 100004 180776.93040000004 BaseRevenue Base 191478.3618 Name6 0.15730977 100005 0.29011873 Name7 15730.977 191478 3618 100006 0.17790082 Name 100007 31639 31799999998 19999999 Name 100008 0.04793823 22.7336 Name 10 100009 31639.231799999998 0.00018596 245.4672 Name 11 100010 122.7336 0.000371 Name 12 4672 100011 135728. 67 Total 100012 0.2056495 135728.67 2593. 6086 0 0.00392971 2593.6086 6086'May be an image of text that says '区 Exportto Excel Name Name Number AB 001255* Case1 AV= 66000000 Base Revenue 100001 Name Ratio 100002 196507 90740000005 AB 008001 10000000 Base Revenue Name4 100003 Ratio Name 180776 6.93040000004 100004 Base Revenue 191478.3618 3618 Name6 0.15730977 100005 0 0.29011873 117414.54119999999 15730. 977 Name7 100006 191478.3618 0.17790082 Name 100007 17414.54119999999 31799999998 Name 100008 0 0.04793823 22.7336 Name 10 100009 31639.231799999998 0.00018596 245.4672 Name 7336 100010 0.00037192 Name 12 100011 45.4672 135728. 67 Total 100012 0.2056495 135728. 2593. 6086 0.00392971 2593 6086'
Caesar
Top achievements
Rank 1
 asked on 28 Dec 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?