After resizing, reordering, hiding, or showing columns in the kendo grid, the grid's data source will be set to

I am encountering an issue with my kendo grid where the data disappears after performing certain actions:

  • Reordering columns using mouse drag and drop
  • Resizing columns using mouse drag and drop
  • Hiding columns through the column menu
  • Showing columns through the column menu

After these events, grid.dataSource.data() = null, leaving only the header row visible in the grid. To address this, I have added the following code to ensure the grid remains intact:

columnReorder: function(e) {
    $timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
},
columnResize: function(e) {
    $timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
},
columnHide: function(e) {
    $timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
},
columnShow: function(e) {
    $timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
}

Despite implementing this workaround, I am still unsure as to why the grid data goes missing when manipulating the columns in this way.

If anyone has any insights or solutions, please share them with me. Your help is greatly appreciated.

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

Could you explain the contrast among "yarn serve," "yarn start," and "yarn build"?

Although both "yarn serve" and "yarn start" can launch my Vue project, I'm unsure of the differences between them. I've heard that "yarn build" is for packaging, but why don't I use it at work? Usually, I just upload my code to git and let ...

Unit testing in Typescript often involves the practice of mocking

One challenge with mocking in Typescript arises when dealing with complex objects, as is the case with any strongly-typed language. Sometimes additional elements need to be mocked just to ensure code compilation, such as using AutoFixture in C#. In contras ...

Steps for creating an HTML report using Intern JS

Our team relies on intern JS for automating functional tests, however we are facing difficulty in generating an html report. I attempted to use locvhtml as suggested by the Intern documentation (https://theintern.github.io/intern/#reporter-lcov), but unfo ...

The functionality of the controls is not functioning properly when attempting to play a video after clicking on an image in HTML5

While working with two HTML5 videos, I encountered an issue with the play/pause functionality. Despite writing Javascript code to control this, clicking on one video's poster sometimes results in the other video playing instead. This inconsistency is ...

What is the purpose of including a function in an AngularJS dependency array?

When it comes to injecting dependencies, the process involves the following steps: inject(["$scope", "$compile", function ($scope, $compile) { ... }]); The syntax used here may seem strange. Placing the function inside the array might appear counter-in ...

Identify and forward to the mobile-friendly version of the site

I am currently working on a website that requires separate files for mobile view as the html layout poses challenges in making it responsive. My goal is to find code that can detect if the user is accessing the site from a mobile device, and automatically ...

Issue with Firefox mobile's camera functionality

I am facing an issue with my web app for mobile devices where I am trying to display the mobile camera using Firefox mobile browser. I am using nodejs with express as a server and connecting to the server via localhost with my smartphone. Although Firefox ...

What is the most efficient way to restrict multiple input fields, each using v-model, to only accept numeric values in Vue.js without duplicating code for every input field?

I have several input fields in Vue.js that I want to restrict to only accept numbers. I want to prevent users from entering any characters except digits from 0-9. I managed to achieve this successfully with a solution that is resistant to copy-paste: C ...

Navigate to a different page following a successful login, without needing to refresh the current

Currently working on a login page where I need to redirect the user to another page upon successful login. I attempted using the pathname property for redirection but encountered some issues. If anyone has a recommendation for a library that can assist w ...

Steps for creating a JSON object to send batch emails using Mailgun

I am looking to dynamically create a JSON object named recipient-variables using two separate arrays - one for emails and the other for first names and IDs. How can I write JavaScript code to achieve this? 'recipient-variables': '{"[em ...

Getting image blob data with Cropper Js in a Laravel controllerNeed help on how to get image blob data

I've been working with Cropper.js and Laravel. I managed to crop an image, put it into FormData, and send it to the Laravel controller using jQuery Ajax. However, I encountered a problem where I am not receiving any data in the controller, only an err ...

Utilizing AngularJS to upload numerous independent attachments to CouchDB

My goal is to upload multiple files to a couchdb document using angularjs. Despite my efforts with an angular.forEach loop, I am facing issues as the asynchronous $http calls do not wait for the previous loop to finish before moving on to the next one. Her ...

Discovering how to efficiently track and respond to changes in MobX state within a React

Within my react native project, I have observed that upon clicking a button, the state of my mobx app undergoes an update. To address this issue, I aim to employ a react lifecycle method that can monitor and automatically reflect this modification. For th ...

avoiding less than or greater than symbols in JavaScript

I'm encountering an issue while attempting to escape certain code. Essentially, I need to escape "<" and ">" but have them display as "<" and "> in my #output div. At the moment, they show up as "&lt;" and "&gt;" on the page. This ...

What is the best method for adding anchors or appending items in aspx pages?

I have created code for an image gallery on my webpage, "gallery.aspx". The situation is that I have an external aspx page with various links. When a user clicks on one of these links, I want them to be redirected to the image gallery but to a specific ima ...

Creating code that is easily testable for a unique test scenario

My function, readFile(path, callback), is asynchronous. The first time it reads a file, it retrieves the content from the file system and saves it in memory. For subsequent reads of the same file, the function simply returns the cached content from memor ...

Is there a javascript file storing an image?

Currently, I am in the process of creating my personal portfolio website and incorporating react-bootstrap for designing my react components. I have been attempting to add an image using the Image component provided by react-bootstrap. However, I noticed ...

What is the best way to finish up the JavaScript code below?

Having just started learning JavaScript, I am struggling to figure out how to use JavaScript to clear the text in a text box and move it below the box when a user starts typing. I've been watching this tutorial http://codepen.io/ehermanson/pen/KwKWEv ...

What could be the reason why the initial console.log is failing to print?

Apologies for the oversight. The !== was a mistake that slipped past me before posting. Thank you for your understanding. I am a beginner in Javascript. I have written this function with winston: function setlogger(log_level = "warn", logfile, scree ...

Determining the size of a custom-typed array in Typescript

Can anyone explain how to find the length of a custom typed array? For example: type TMyArray = IProduct[] interface IProduct { cost: number, name: string, weight: number } So, how can we determine the length in this case: const testArr: TMyArray ...