Encountering issue with filtering in the Telerik VueJS grid causing errors

Encountered an error while trying to clear a set filter in vuejs (native) grid filtering implementation. The specific error message reads:

[Vue warn]: Error in v-on handler: "RangeError: invalid array length"
  found in
      ---> <GridFilterCell>
            <FilterRow>
             <HeaderRow>
               <Header>
                 <Grid>
                   <Reports3> at src/components/Reports3.vue
                     <Target> at src/components/Target.vue
                       <App> at src/App.vue
                         <Root> vue.runtime.esm.js:619
  
  
  RangeError: "invalid array length"
     node_modules FilterRow.js:51
     node_modules FilterRow.js:115
     node_modules FilterRow.js:150
    VueJS 4
     node_modules GridFilterCell.js:258
     node_modules GridFilterCell.js:229
     node_modules GridFilterCell.js:164
  VueJS 3
   vue.runtime.esm.js:1888

The grid definition is as follows:

<Grid :style="{height: '450px'}"
              :data-items="reports"
              :sortable="true"
              :sort="sort"
              :filterable="true"
              :filter="filter"
              :filter-cell-render="filterRender"
              :pageable="true"
              :skip="skip"
              :take="take"
              :total="totalRecords"
              :columns="columns"
              @filterchange="filterChange"
              @sortchange="sortChangeHandler"
              @pagechange="pageChangeHandler">}
</Grid>

Below are the data() filter methods:

data(){
    return{
          filter: {
            logic: "and",
            filters: [
               { field: "institutionId", operator: "neq", value: 0 },
               { field: "typeCode", operator: "neq", value: "" },
               { field: "name", operator: "neq", value: "" }
           ]
         },
         filterChange: function (e) {
           this.filter = e.filter;
         },
         filterRender: function (h, defaultRendering, props, change) {
         return defaultRendering;
       }
     }
}

Referencing the telerik document page for guidance: https://www.telerik.com/kendo-vue-ui/components/grid-native/filtering/

Answer №1

I encountered a similar issue with the telerik Vue grid (native) being in beta, which may still have some bugs like this one.

Here is a temporary solution until it gets resolved by the telerik team.

To fix this, navigate to the following path in your project folder:
node_modules@progress\kendo-vue-grid\dist\es\header\FilterRow.js

Locate this line:

this.$emit.apply(this, __spreadArrays(['filterchange', filtersResult], e));

Replace it with the following line:

this.$emit.apply(this, ['filterchange', filtersResult, e]);

After making this change, you should be good to go.

The usage of __spreadArrays seems to be a TypeScript (3.6) command which might not belong in FilterRow.js and is probably unnecessary since the objects filterchange, filtersResult, and e are not arrays themselves. You can verify this by debugging. Remember that any updates to the telerik grid version will require you to modify the code line again until the bug is fixed.

I hope this information proves helpful.

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

VueJS List Animations: JavaScript hooks not triggered for all elements in the list

I've arranged a grid of divs in rows and columns, along with a transition group that looks like this: <div class="row" v-for="row in grid"> <div class="col-md-3" v-for="col in row"> <transition-group v- ...

How can Vue.Draggable's draggable functionality be toggled on and off?

I'm faced with a situation where the elements being wrapped should only be draggable under specific conditions. I managed to handle it in my HTML code like this: <draggable v-if='somePassingConditions'> <my-component></my-comp ...

Running "vue ui" with Node.js v17.2.0 - A step-by-step guide

After updating to Node.js v17.2.0, I am facing issues with running "vue ui" in my project. The error message I receive indicates a problem with node modules: at Object.readdirSync (node:fs:1390:3) at exports.readdir (/usr/local/lib/node_modules/@vu ...

vue-spa breadcrumbs component

I am currently working on enhancing the navigation of my vue-spa project by implementing breadcrumbs. These breadcrumbs should be capable of displaying properties as breadcrumb-items, and each part of a route must be correctly identified as a breadcrumb-it ...

Issue: In Vuetify, the child component 'v-tabs' is displaying an offsetWidth value of 0

To showcase the issue, I have created a codepen: https://codepen.io/anon/pen/vzqgJB Within the Vuetify v-app, there is a router-view. <div id="app"> <v-app> <v-content> <v-container> {{$route.path}} &l ...

Tips for obtaining the state of a local variable in a Vue method:

How do I access the state of a local variable within a method in Vue? I am looking to set a specific value for the dialog in order to open the popUp. After loading the data, my goal is to open the popUp by using this porting method. import { mapState, m ...

Display in Google Chrome without any dialogues

Hello friends, I am currently working on adding a print button to my website. I am testing it in Chrome and would like the page to be printed directly without showing any dialog boxes. However, I am facing some difficulties with this process. If anyone has ...

Exploring Vue.js Vee Validate: Step-by-step guide to implementing element-specific validations

I have integrated VeeValidate plugin into my project for validation purposes. Here is the form that requires validation. https://i.stack.imgur.com/r1ZnN.png If I need to validate all fields upon clicking the save button this.$validator.validateAll().th ...

Display JSON data using Vue.js

Trying to display JSON file results using Vue.js, with the goal of showing the result in a value. Here is the code snippet: data () { return { fetchData: function () { var self = this; self.$http.get("/api/casetotalactivation", functio ...

Vue: auto-suggest feature in a text input field

I am looking to implement a text field with typeahead functionality. Essentially, I have a collection of words and as you start typing in the field, suggestions should appear based on the input. The challenge is that it should be capable of providing sugge ...

Transitioning from Vuetify 2 to Vuetify 3: Handling v-list-item-icon with v-if Conditionals

I have streamlined this post to focus solely on v-list-item-icon; if that's what you're here for, scroll down for the answer. A commenter suggested splitting my migration questions into separate posts. I've followed that advice and created ...

Exploring Vue Slots: A guide to parsing and rendering slot components

Currently facing a challenge while developing a web page using Vue, specifically with parsing and rendering the child components inside the <slot>. I need to extract the slot content, convert it into an array of components, and display these compo ...

What is the proper way to implement ref in typescript?

Currently, I am in the process of learning how to use Vue3 + Typescript. Previously, I have developed Vue2 applications using plain JavaScript. In my current project, I am attempting to define a reactive variable within the setup() function: setup() { ...

No entries found in the Nuxt/content module's array

<template> <div> <input v-model="searchQuery" type="search" autocomplete="off" placeholder="Search Articles" /> <ul v-if="articles.length"> ...

Issue with Laravel Composer: Failed to install, restoring original content in ./composer.json

I am fairly new to Laravel and I have been using Laravel 5.8 for my project development. Recently, I needed to access the file ExampleComponent.vue in the resources/js/components directory but it was not there. After referencing this link, I came to know ...

Parsing error: Unforeseen token encountered. Consider adding a supplementary loader to manage the output of these loaders

Could someone please break down this syntax message?.length === 1 and show me how to convert it into standard JavaScript? https://i.stack.imgur.com/20Ui6.png I am encountering an error when trying to use a Vue.js component that I downloaded from another ...

Passing props from a parent component to a nested child component in Vue 3

My goal is to achieve the functionality described in the title. Suppose I have the following structure: parent -> child -> secondChild Currently, there is a variable called isActive in the parent component. Below is how it can be implemented: paren ...

What is the best way to incorporate this into a Vue project?

I am in the process of transitioning my code to Vue.js, so I am relatively new to Vue. In the screenshot provided (linked below), you can see that there are 4 columns inside a div with the class name columns. I attempted to use the index, like v-if='i ...

Is the Vue Vite PWA plugin failing to implement runtime caching for APIs?

After adding the PWA plugin to my Vuejs project with Vite, I successfully precached the assets. However, I encountered an issue when trying to implement runtime caching for API requests. Despite setting up the configuration, the runtime cache file doesn&ap ...

Issue Encountered During Eclipse Vue.js Codemix Installation

When attempting to install Vue.js :: CodeMix from the "Eclipse Marketplace," an error occurred: Cannot complete the installation process because one or more required items could not be found. Software being installed: Vue.js Pack :: CodeMix 1.1.0 (com.ge ...