Kendo UI's powerful component library allows you to quickly go from conception to building complete applications. It has over 100 components that can be easily integrated into your React, Angular or Vue applications. Kendo UI is actually a collection of four native JavaScript libraries, each built for its corresponding framework. What’s more, as we mentioned earlier, these components are extremely theme customization and you can adjust their appearance as you want.
The real advantage of Kendo UI is that it takes on the heavy lifting . Excellent style is important, but what really distinguishes Kendo UI from other component frameworks is its out-of-the-box feature.
For example: data processing . You don't have to spend a lot of time looking for the best way to bind your data to components, Kendo UI has handled it all for you, allowing you to spend more time focusing on theme design and UI optimization.
To understand how Kendo UI simplifies data processing, the best way is to actually do it, so...
Let's take a look at the Angular Grid component
This is the data grid component of Kendo UI for Angular. It contains a lot of data, right? What we see is a list of employees showing each person’s name, images, and other information.
Like all Kendo UI components, it is not a simple data grid component that is common across multiple frameworks. This data grid is specially built and designed for Angular, just as their KendoReact Grid components are specifically designed for React.
Usually, a simple<table> Elements <em>may</em> satisfy the needs, right? But Kendo UI for Angular's data grid contains many additional features that can significantly improve the user experience. You can immediately notice that it provides interactive features such as exporting data to Excel or PDF. There are many other extraordinary features that would otherwise take a lot of time and effort to achieve.<h3 id="filter"> filter</h3>
<p> There is a function here: filtering of data grids. Suppose you are looking at a list of employees similar to the data grid example above, but the company has thousands of employees. Without a range of features like search, sortable, and paging, it is difficult to find a specific person—and Kendo UI's data grid has these capabilities.</p>
<p> Users can quickly parse data bound to an Angular data grid. You can filter through a dedicated filter row, or by clicking the filter menu pop-up from the filter icon in the column header.</p>
<p> The documentation for Kendo UI is excellent. Here's how to get the component up and running quickly:</p>
<h3 id="First-import-the-component"> First, import the component</h3>
<p> There is no trick here - importing a data grid like importing any other component:</p>
<pre class="brush:php;toolbar:false"> <code>import { Component, OnInit, ViewChild } from '@angular/core'; import { DataBindingDirective } from '@progress/kendo-angular-grid'; import { process } from '@progress/kendo-data-query'; import { employees } from './employees'; import { images } from './images';</code></pre>
<h3 id="Next-call-the-component"> Next, call the component</h3>
<pre class="brush:php;toolbar:false"> <code>@Component({ selector: 'my-app', template: `<kendo-grid> // ...</kendo-grid> ` })</code></pre>
<p> Of course, this is incomplete because next we have to...</p>
<h3 id="Configure-Components"> Configure Components</h3>
<p> The key feature we want to enable is filtering, but Kendo's Angular Grid accepts various functional parameters that can be enabled in one fell swoop, such as sorting and grouping, pagination, and virtualization.</p>
<p> filter? It is only possible to bind it to the column header with just one line of code.</p>
<pre class="brush:php;toolbar:false"> <code>@Component({ selector: 'my-app', template: `<kendo-grid filter="" kendogridselectby="id" true=""> // etc.</kendo-grid> ` })</code></pre>
<h3 id="Then-mark-the-rest-of-the-UI"> Then, mark the rest of the UI</h3>
<p> We won't go into it in depth here. There is an excellent example of what looks like in Kendo UI's documentation. This is also a good time to deal with styles, which are done in style parameters. Similarly, the theme setting of Kendo UI components is very simple.</p>
<p> Even before we insert the actual data, we already have a nice-looking data grid!</p>
<h3 id="Finally-bind-the-data"> Finally, bind the data</h3>
<p> When we import components, you may have noticed that we import the "employee" data at the same time. We need to bind that data to the component. Now, people like me may be hiding in the corner and crying, but Kendo UI makes the process too simple.</p>
<pre class="brush:php;toolbar:false"> <code>// 在初始化時激活組件export class AppComponent implements OnInit { // 將員工數(shù)據(jù)綁定到組件@ViewChild(DataBindingDirective) dataBinding: DataBindingDirective; // 將網(wǎng)格的數(shù)據(jù)源設(shè)置為員工數(shù)據(jù)文件public gridData: any[] = employees; // 將數(shù)據(jù)源應(yīng)用于Grid 組件視圖public gridView: any[]; public mySelection: string[] = []; public ngOnInit(): void { this.gridView = this.gridData; } // 開始處理數(shù)據(jù)public onFilter(inputValue: string): void { this.gridView = process(this.gridData, { filter: { // 設(shè)置邏輯類型(and/or) logic: "or", // 定義篩選器及其運(yùn)算符filters: [ { field: 'full_name', operator: 'contains', value: inputValue }, { field: 'job_title', operator: 'contains', value: inputValue }, { field: 'budget', operator: 'contains', value: inputValue }, { field: 'phone', operator: 'contains', value: inputValue }, { field: 'address', operator: 'contains', value: inputValue } ], } }).data; this.dataBinding.skip = 0; } // ... }</code></pre>
<h3 id="Let-s-take-a-look-at-the-demo-again"> Let's take a look at the demo again</h3>
<p> Such powerful features are achieved with minimal effort. The Kendo UI API is very broad, and even the most complex features are very simple.</p>
<p> We haven't even touched on other great features of Kendo UI components yet. For example, accessibility. Can you imagine how much thought it takes to make such a component easy to access? Like all other powerful features we have obtained, Kendo UI solves accessibility issues for us, taking on the heavy lifting of creating a keyboard-friendly UI that complies with WCAG 2.0 Alice, Section 508, and WAI-ARIA standards.</p>
<p> Get started with Kendo UI Data Grid!</p>
</table>
The above is the detailed content of Building an Angular Data Grid With Filtering. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

CSS blocks page rendering because browsers view inline and external CSS as key resources by default, especially with imported stylesheets, header large amounts of inline CSS, and unoptimized media query styles. 1. Extract critical CSS and embed it into HTML; 2. Delay loading non-critical CSS through JavaScript; 3. Use media attributes to optimize loading such as print styles; 4. Compress and merge CSS to reduce requests. It is recommended to use tools to extract key CSS, combine rel="preload" asynchronous loading, and use media delayed loading reasonably to avoid excessive splitting and complex script control.

ThebestapproachforCSSdependsontheproject'sspecificneeds.Forlargerprojects,externalCSSisbetterduetomaintainabilityandreusability;forsmallerprojectsorsingle-pageapplications,internalCSSmightbemoresuitable.It'scrucialtobalanceprojectsize,performanceneed

No,CSSdoesnothavetobeinlowercase.However,usinglowercaseisrecommendedfor:1)Consistencyandreadability,2)Avoidingerrorsinrelatedtechnologies,3)Potentialperformancebenefits,and4)Improvedcollaborationwithinteams.

CSSismostlycase-insensitive,butURLsandfontfamilynamesarecase-sensitive.1)Propertiesandvalueslikecolor:red;arenotcase-sensitive.2)URLsmustmatchtheserver'scase,e.g.,/images/Logo.png.3)Fontfamilynameslike'OpenSans'mustbeexact.

Autoprefixer is a tool that automatically adds vendor prefixes to CSS attributes based on the target browser scope. 1. It solves the problem of manually maintaining prefixes with errors; 2. Work through the PostCSS plug-in form, parse CSS, analyze attributes that need to be prefixed, and generate code according to configuration; 3. The usage steps include installing plug-ins, setting browserslist, and enabling them in the build process; 4. Notes include not manually adding prefixes, keeping configuration updates, prefixes not all attributes, and it is recommended to use them with the preprocessor.

CSScounterscanautomaticallynumbersectionsandlists.1)Usecounter-resettoinitialize,counter-incrementtoincrease,andcounter()orcounters()todisplayvalues.2)CombinewithJavaScriptfordynamiccontenttoensureaccurateupdates.

In CSS, selector and attribute names are case-sensitive, while values, named colors, URLs, and custom attributes are case-sensitive. 1. The selector and attribute names are case-insensitive, such as background-color and background-Color are the same. 2. The hexadecimal color in the value is case-sensitive, but the named color is case-sensitive, such as red and Red is invalid. 3. URLs are case sensitive and may cause file loading problems. 4. Custom properties (variables) are case sensitive, and you need to pay attention to the consistency of case when using them.

CSSselectorsandpropertynamesarecase-insensitive,whilevaluescanbecase-sensitivedependingoncontext.1)Selectorslike'div'and'DIV'areequivalent.2)Propertiessuchas'background-color'and'BACKGROUND-COLOR'aretreatedthesame.3)Valueslikecolornamesarecase-insens
