Angular 9: Missing sort icon in Kendo grid

I've encountered an issue with my project developed in Angular 9 and utilizing the latest version of the Kendo grid. While both sorting and resizing columns are enabled within the grid, everything functions properly when accessing the application locally through localhost. However, upon deployment to the server, the sort icons mysteriously disappear. Additionally, when attempting to resize a column, the icon appears momentarily before disappearing upon hover. Any ideas on how to resolve this issue?

Answer №1

I encountered a similar issue and attempted various methods to replicate it in a smaller Angular application for sharing with Telerik support. Despite creating a sample app with the same source code, the problem persisted. I hold no fault with the Telerik community, but I am unable to disclose my original app's code.

Below are some of the steps I tried:

  • Debugging and console logging the Telerik source
  • Developing a new app with identical grid code
  • Configuring angular, package, polyfills, browserslist, tsconfig.app & tsconfig.es5 settings similarly on a separate app
  • Testing different angular versions
  • Restructuring the grid implementation

Frustrated with the bug, I resorted to using a CSS workaround solution as shown below.

search-grid.component.scss

 .k-icon {
  height: 1em;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  font-family: 'WebComponentsIcons';
  font-style: normal;
  font-variant: normal;
  font-weight: normal;
  line-height: 1;
  speak: none;
  text-transform: none;
  text-decoration: none;
  display: inline-block;
  vertical-align: middle;
}

.k-i-sort-asc-sm, .k-i-sort-desc-sm {
  margin-left: calc(1rem - 1px);
}

.k-i-sort-asc-sm::before {
  content: '\e127';
}

.k-i-sort-desc-sm::before {
  content: '\e128';
}

kendo-grid th[aria-sort='ascending'] span span[aria-label='Sortable'] {
  @extend #{'.k-icon', '.k-i-sort-asc-sm'};
}
kendo-grid th[aria-sort='descending'] span span[aria-label='Sortable'] {
  @extend #{'.k-icon', '.k-i-sort-desc-sm'};
}

If you are modifying kendo grid styles, ensure that component encapsulation is set to

ViewEncapsulation.None

Example

@Component({
  selector: 'app-search-grid',
  templateUrl: './search-grid.component.html',
  styleUrls: ['./search-grid.component.scss'],
  encapsulation: ViewEncapsulation.None,
})

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to ensure that the hover state div displays above all other elements and outside the container?

I have spent the past two days working on this particular issue. Example: It's a rather complex design, so to avoid pasting a lot of code here, I recreated the main structure on this jsfiddle and included the simplified code at the end of this post: ...

Changing dot notation to bracket notation in Angular

Having trouble using dynamic columns in a Primeng table? The column fields need to be in bracket notation for this setup. What if you have a column with nested JSON structure and you're not sure how to write that in bracket notation? Don't worry, ...

Show the currency values with decimal points

How can I modify this code to display the currency value with fractions and the 3 characters for the currency type? <td>{{transaction.amount | currency: transaction.currency}}</td> Instead of $10,080.00, I'm looking to display it as 10,0 ...

Why does my Div seem to be ignoring the height inherited from the html or body elements?

Is there a way to make the landing-wrapper div expand to fill 100% of the screen on a landing page? Many suggestions advise setting the html/body height to 100%. I've already tried that, but it doesn't seem to be working. I'm using React and ...

What steps do I need to take to start my sliding animation from the very edge of the page?

I'm facing an issue with my animated SVG image sliding from the left into the frame. The problem is, the animation starts at the object's left edge instead of the page's left edge. Is there a way to make the animation start at the edge of ...

Ways To Create Multiple HTML Players

After successfully creating an audio player with html, css and javascript, I now face the challenge of adding multiple players to a single page. However, when attempting to play any player besides the first one, it only plays the initial player. How can ...

Ways to implement data pagination in an Ionic 4 application using ngx-pagination

I tried following the instructions on this page (https://www.npmjs.com/package/ngx-pagination) to integrate ngx-pagination into my Ionic app. However, I encountered an error indicating that the ngx-pagination package was not installed successfully. Are the ...

Prevent another user from accessing a webpage while another user is already active on it using ReactJs

Currently, I am developing a system where multiple users will be logged in simultaneously. However, it is essential to ensure that two individuals cannot access the same user record at the same time. How can I prevent this from happening? For example, if t ...

The MySQL Query Maker

To fetch data from a database for only one row and then generate separate pieces of information, use the following code: <?php session_start(); ob_start(); error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set("display_errors", 1); set_time_limit(1 ...

Effortlessly adding loading spinners to images with Ionic 2, Ionic 3, and Ionic 4!

My Ionic2 application utilizes ion-img to properly load images, but I am seeking a way to notify the user that the picture is loading. Any suggestions would be greatly appreciated! EDIT : If you must use the ion-img tag, here is the solution. Otherwise, c ...

The z-index of 999 in CSS is not functioning as expected on both Google Chrome and Safari browsers

To ensure the slider text is readable in white color, we have applied a black background with 0.65 opacity CSS on the slider image. This allows the white text to stand out effectively. The following CSS code was used for this effect: .zlslides .ms-slide- ...

Images positioned next to each other appear distorted when adjusting for different screen sizes

I have been struggling with this issue for quite some time and I just can't seem to get it right. My goal is to display two images side by side with a gap between them. The problem arises when the browser is resized, as the gap disappears and the im ...

Upon launching Google Chrome, a series of errors plague the WSL2 Ubuntu setup while running Karma and Jasmine for Angular testing

My Angular project utilizes Google Chrome for testing with Karma & Jasmine, but upon starting Chrome, I encounter multiple errors. Despite trying various solutions found on Stack Overflow, none have been successful. The versions in use are: Chrome 99.0.4 ...

Detecting if a click listener is registered within an Angular 2+ component

In the process of developing a reusable component featuring a rounded image thumbnail, I am aiming to incorporate functionality that detects if a click listener has been assigned to it. If a developer has applied a (click)=anyClickCallbackFunction() on the ...

Angular 5 is having trouble with VideoJS playback

Recently, I started learning angular 5 and wanted to incorporate videojs into my project. Here is the code snippet I have tried: <video *ngIf="url" id="video" class="video-js vjs-default-skin vjs-big-play-centered vjs-16-9" controls preload="auto"> ...

What causes a CSS layout to become misaligned when a line border is added?

After reviewing solutions provided in an answer to a previous question, I attempted to implement a line border within a div nested inside another div. Unfortunately, this implementation caused the div to become distorted. Why did this happen? Markup: &l ...

What is the best way to dynamically load SCSS in an Angular 6 application based on individual customers within the same project?

I need to customize the theme and color scheme of my application for each individual customer as it is being used by various clients. How can I dynamically load a specific SCSS file based on the customer in Angular 6? ...

The functionality of Laravel registration is currently being disrupted by hidden fields

Recently, I started using Laravel and encountered a problem with my registration form. In the form, there is a select dropdown refer here that contains two options - Faculty and Student. When a user selects Student, fields for grade and section should be ...

Angular code for opening a PDF from an API response in a new tab

It's been nearly three days and I could really use some assistance with this issue I'm facing. Inside my Node application, there is an API call that utilizes HTTPS to connect to an external API and retrieve a PDF file. The PDF code snippet looks ...

Error encountered: Unrecognized media in CSS validation and parsing issue

I've been having trouble validating my CSS and keep encountering error messages. Despite ensuring I have closing brackets, there are parse errors on line 39 and unrecognized media issues on lines 79 and 81. Additionally, lines 70 and 89 also trigger p ...