Spreadsheet - Filter Spaces in Cells

1 Answer 15 Views
Spreadsheet
Top achievements
Rank 1
Iron
asked on 16 Dec 2021, 09:29 AM

Is there a way to filter the JSON data saved in the spreadsheet out of cells that are not filled with data but contain Spaces

1 Answer, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 20 Dec 2021, 07:11 PM

Hello 三,

Please take a look at the following couple of ways in which you can filter based on the space character:

Filter with DropDown Menu

One way in which you can search for only specific filtered items is to open the filter dropdown and select the items:

Please take a look at this Progress Kendo UI Dojo which is used in the gif above.

Programmatic CustomFilter 

Another option is to create a kendo.spreadsheet.CustomFilter which can be applied to the Kendo UI Spreadsheet based on your preferences:

JavaScript

          //get spreadsheet, activesheet, and range
          var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
          var sheet = spreadsheet.activeSheet();
          var range = sheet.range("A3:G49");

          //set custom filter based on your preferences
          var filter = new kendo.spreadsheet.CustomFilter({
            logic: "or",
            criteria:[
              { operator: "matches", value: " "},
              { operator: "matches", value: "  "},
              { operator: "matches", value: "   "},
              { operator: "matches", value: "    "},
              { operator: "matches", value: "     "},
              { operator: "matches", value: "      "}
            ],
          });

          //set filter
          range.filter([ { column: 4, filter: filter } ]);
          

Here is the Progress Kendo UI Dojo which provides the approach above.

 

Feature Request

Based on the inquiry, I have created a feature request with a vote on your behalf for the Kendo UI SpreadSheet to be able to filter Null or WhiteSpace values easier with the built-in API.  Please feel free to follow the request and provide any comments within the thread. 

Please let me know if you have any questions regarding the above. 

 

Regards,
Patrick | Technical Support Engineer, Senior
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Spreadsheet
Asked by
Top achievements
Rank 1
Iron
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or