This is a migrated thread and some comments may be shown as answers.

Kendo Grid - Global search not working

6 Answers 1912 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 20 Mar 2018, 03:14 PM

I have kendo grid, which has 1000+ records. I want to select row which is present in page 33.  I achieve this 

....
$scope.grid = $("#grid").data("kendoGrid");

var index = $scope.grid.dataSource.indexOf(rowData);
var page = Math.floor(index / $scope.grid.dataSource.pageSize());
$scope.grid.dataSource.page(++page);

var targetIndex = index - (page * $scope.grid.dataSource.pageSize());
var row = $("#grid").find("tr:eq(" + targetIndex + ")");
$scope.grid.select(row);
$scope.grid.content.scrollTop($(row).position().top);
...

The above code working perfectly. Then I'm trying to apply global search which is filters data, but nothing shown in the user interface.

function applyGlobalFilter(gridData, searchText) {
     gridData = $filter('filter')(gridData, searchText);
     $scope.grid.dataSource.data(gridData);
}

Thanks in advance

6 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 23 Mar 2018, 08:14 AM
Hi Michael,

Thank you for hte provided code.

I have investigated it and I assume that filter function does not return any records and then an empty array is passed to the dataSource.

For filtering the Kendo Grid I recommend you to use the API of the dataSource (filter method).

e.g.

function applyGlobalFilter(gridData, searchText) {    
     $scope.grid.dataSource.filter({field: 'FieldName', operator: 'contains', value: searchText});
}


Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Michael
Top achievements
Rank 1
answered on 26 Mar 2018, 04:32 AM

How do we apply global search in grid? it should apply to all the columns which is present in grid. We have n number of columns, it could hide/show depends on user preference. So we must filter the records with only columns present in grid. 

Thanks.

0
Accepted
Georgi
Telerik team
answered on 26 Mar 2018, 01:28 PM
Hi Michael,

Thank you for the update.

Please refer to the following article which demonstrates how to create a global search for the Kendo Grid:



Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
shah
Top achievements
Rank 1
answered on 10 Dec 2019, 06:41 AM
Hi Sir !
I have an issue in Kendo grid Search panel. i implement the code for search panel but it shows Search button instead of Search panel
in Asp.net Core
Note: UI version: telerik.ui.for.aspnet.core -Version 2019.3.917. 
snapshot is attached
0
shah
Top achievements
Rank 1
answered on 11 Dec 2019, 01:04 PM
Hi Sir !
I have an issue in Kendo grid Search panel. i implement the code for search panel but it shows Search button instead of Search panel
in Asp.net Core
Note: UI version: telerik.ui.for.aspnet.core -Version 2019.3.917. 
snapshot is attached
0
Georgi
Telerik team
answered on 12 Dec 2019, 02:20 PM

Hello Shah,

Thank you for the provided screenshot,  indeed the search panel should not render a button. However with the current information it would be hard to pinpoint the exact cause. Could you please provide us with little more details - the configuration of the grid?

The same seems to work correctly in our demos:

Having said that, sharing a demo that clearly replicates the issue would definitely help us fully understand the case and we will be able to provide further assistance to the best of our knowledge.
 

Regards,
Georgi
Progress Telerik

Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Michael
Top achievements
Rank 1
shah
Top achievements
Rank 1
Share this question
or