Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(grids): cleanup search snippets #5851

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions en/components/grids_templates/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ The methods from above return a **number** value (the number of times the @@igCo
### Display results count
Let's also display the position of the current occurrence, along with the total results count! We can do this by using the grid's `lastSearchInfo` property. This property is automatically updated when using the **find** methods.

- The `@@igObjectRef.lastSearchInfo.matchInfoCache.length` value will give us the total results count.
- The `@@igObjectRef.lastSearchInfo.matchCount` value will give us the total results count.
- The `@@igObjectRef.lastSearchInfo.activeMatchIndex` value will give us the index position of the current occurrence (match).

```html
<!--searchgrid.component.html-->

<div class="resultsText" *ngIf="@@igObjectRef.lastSearchInfo">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchInfoCache.length }} results
<div class="resultsText">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchCount }} results
</span>
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length == 0">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount == 0">
No results
</span>
</div>
Expand Down Expand Up @@ -305,11 +305,11 @@ On the right in our input group, let's create three separate containers with the
<!--searchgrid.component.html-->

<igx-suffix *ngIf="searchText.length > 0">
<div class="resultsText" *ngIf="@@igObjectRef.lastSearchInfo">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchInfoCache.length }} results
<div class="resultsText">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchCount }} results
</span>
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length == 0">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount == 0">
No results
</span>
</div>
Expand Down
18 changes: 9 additions & 9 deletions jp/components/grids_templates/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ public exactMatch: boolean = false;
### 検索結果の個数を表示
検索で見つかった現在の場所と総個数を示します。グリッドの `lastSearchInfo` プロパティを使用します。このプロパティは、**find** メソッド使用時に自動的に更新されます。

- `@@igObjectRef.lastSearchInfo.matchInfoCache.length` 値は検索で見つかった個数です。
- `@@igObjectRef.lastSearchInfo.matchCount` 値は検索で見つかった個数です。
- `@@igObjectRef.lastSearchInfo.activeMatchIndex` 値は、現在の一致 (出現) のインデックス位置です。

```html
<!--searchgrid.component.html-->

<div class="resultsText" *ngIf="@@igObjectRef.lastSearchInfo">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchInfoCache.length }} results
<div class="resultsText">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchCount }} results
</span>
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length == 0">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount == 0">
No results
</span>
</div>
Expand Down Expand Up @@ -306,11 +306,11 @@ public clearSearch() {
<!--searchgrid.component.html-->

<igx-suffix *ngIf="searchText.length > 0">
<div class="resultsText" *ngIf="@@igObjectRef.lastSearchInfo">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchInfoCache.length }} results
<div class="resultsText">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchCount }} results
</span>
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length == 0">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount == 0">
No results
</span>
</div>
Expand Down
18 changes: 9 additions & 9 deletions kr/components/grids_templates/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@ public exactMatch: boolean = false;
#### 결과 수 표시
총 결과 수와 함께 현재 검색 위치를 표시합니다! 그리드의 `lastSearchInfo` 속성을 사용하여 이것을 실행할 수 있습니다. 이 속성은 **find** 메소드를 사용할 때 자동으로 업데이트됩니다.

- `@@igObjectRef.lastSearchInfo.matchInfoCache.length` 값은 총 결과 수입니다.
- `@@igObjectRef.lastSearchInfo.matchCount` 값은 총 결과 수입니다.
- `@@igObjectRef.lastSearchInfo.activeMatchIndex` 값은 현재 검색(일치)의 인덱스 위치입니다.

```html
<!--searchgrid.component.html-->

<div class="resultsText" *ngIf="@@igObjectRef.lastSearchInfo">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchInfoCache.length }} results
<div class="resultsText">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchCount }} results
</span>
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length == 0">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount == 0">
No results
</span>
</div>
Expand Down Expand Up @@ -294,11 +294,11 @@ public clearSearch() {
<!--searchgrid.component.html-->

<igx-suffix *ngIf="searchText.length > 0">
<div class="resultsText" *ngIf="@@igObjectRef.lastSearchInfo">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchInfoCache.length }} results
<div class="resultsText">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount > 0">
{{ @@igObjectRef.lastSearchInfo.activeMatchIndex + 1 }} of {{ @@igObjectRef.lastSearchInfo.matchCount }} results
</span>
<span *ngIf="@@igObjectRef.lastSearchInfo.matchInfoCache.length == 0">
<span *ngIf="@@igObjectRef.lastSearchInfo.matchCount == 0">
No results
</span>
</div>
Expand Down
Loading