Issues with Kendo Grid showing incomplete data and columns

Having trouble populating a kendo grid with column titles, as some columns appear empty despite having data when checked in the console log.

$(function () {
  $("#uploadBtn").click(function () {
    var url = window.rootUrl + 'Upload/UploadM';
    var fileUpload = $("#fileID").get(0);
    var files = fileUpload.files;
    var data = new FormData();
    data.append(files[0].name, files[0]);

    $.ajax({
      url: url,
      type: "POST",
      contentType: false, // Not to set any content header
      processData: false, // Not to process data
      data: data
    }).done(function (res) {
      console.log("dataTable", res)
      $('#AttachGrid').empty();
      $("#AttachGrid").kendoGrid({
        columns: [
          { field: "DATA_CATEGORY_QOS_CODE", title: "QOS" },
          { field: "DOWNLOAD_SPEED_CLASS_CODE", title: "download" },
          { field: "OPERATOR_OBJECTID", title: "operator" },
          { field: "SETTLEMENT_CODE", title: "settlement" },
          { field: "SHAPE", title: "shape" },
          { field: "TECHNOLOGY_CODE", title: "tech" },
          { field: "UPLOAD_SPEED_CLASS_CODE", title: "upload" },
          { field: "Message", title: "message" }
        ],
        dataSource: res.Data
      });
    })
  });
});

This is how the table appears using this code: https://i.sstatic.net/2Q6Lb.png https://i.sstatic.net/Ex1Te.png

The data seems to be present, but it's not displaying correctly in the kendo grid. However, if I remove the columns property, the entire dataset loads correctly.

$.ajax({
      url: url,
      type: "POST",
      contentType: false, // Not to set any content header
      processData: false, // Not to process data
      data: data
    }).done(function (res) {
      console.log("dataTable", res)
      $('#AttachGrid').empty();
      $("#AttachGrid").kendoGrid({
        
        dataSource: res.Data
      });
    })

https://i.sstatic.net/QUphN.png Unable to customize column titles in this way. Any idea what could be causing the issue?

Answer №1

Clearly stated..... The property names in your JSON Data do not align with the column fields.

The JSON is labeled as DATA_CATEGORY_QOS_OBJECTID while the field is listed as DATA_CATEGORY_QOS_CODE, causing Kendo UI to not match correctly........

Similar issue persists with other properties/fields~

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

Is it possible to import data into a script?

When working with Angular, I am attempting to: $scope.data = "<script> alert('hi'); </script>"; Unfortunately, this approach does not seem to be effective. I also experimented with adding ng-bind-html but did not achieve any success ...

Nested loops in JavaScript can be combined with promises to efficiently handle

I am facing a challenge in looping through an array that contains another array as one of the parameters. My goal is to iterate through this nested array according to specific requirements, and then execute a function once the parent loop is finished. Can ...

Submitting Files to the API using Vue.js

I have the following code in Vue.js and I am trying to upload a file, but my issue is that I want to save the filename of the uploaded file to the JSON API using a POST method. Is there a way to achieve this? Thank you in advance. <div class="input-f ...

Create a Vue slot layout that mirrors the structure of Material UI

This is the code I have been working on: <tr :key="index" v-for="(item, index) in items"> <td v-for="header in headers" :key="header.value"> {{ item[header.value] }} </td> <td> & ...

Setting the value for a textbox using Jquery's .val() function works, while .attr() does not have the

//unable to get it working $("#TextBoxID1").attr("value","HI Value Change") //works perfectly fine $("#TextBoxID2").val("HI Value Change") <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <input type= ...

Implement a click event for the X-Axis label in Angular 2 Highcharts

I'm currently facing a challenge with hand-rolling a solution that involves adding a click listener to an X-Axis label in a column chart using the HighCharts API within an Angular 2+ application. Here is what I have gathered so far: I am utilizing ...

AngularJS's support for html5mode on GitHub pages is now available

Is it feasible for GitHub pages to accommodate AngularJS in html5mode? I came across a source online suggesting that it can be done with a fallback page for 404 errors. However, this solution seems flawed as it may result in multiple 404 errors, which wou ...

Receiving feedback from an Ajax request

When attempting to retrieve the responseText from an AJAX call created in plain JavaScript, there seems to be an issue where Firebug can detect the request but cannot obtain a reference to the responseText. Below is the code for the function: function ge ...

jQuery: Managing and modifying values for dynamically generated input elements

Hello, I am currently working with the latest version of jQuery and have a table set up where clicking on the "Add" button appends a row of inputs. My goal is to calculate the total price for each particular product based on keyup events (i.e., qty * price ...

Exploring the method of extracting link text with jQuery

Is there a way to extract link text using jQuery? Here is the link: <a href="https://www.google.com" id="id1">google site</a> I am looking to retrieve the text "google site" using jQuery. ...

Creating a design utilizing HTML columns with a set height and the ability to scroll horizontally

For my android project, I have a requirement to display a view (WebView) that dynamically loads content. The content will consist of <div class="content-item"> tags that are added by JavaScript to <div class="content-holder"> after the page has ...

Error encountered: _moment2.default.date is not a recognized function within the React application

I keep encountering an issue when attempting to utilize a date from Moment.js in the constructor, componentWillMount, or componentDidMount. The error message I receive is: Uncaught TypeError: _moment2.default.date is not a function It's worth noting ...

Encountering the "Cannot Retrieve" error in express.js while navigating to the ID of an object

I'm in the process of developing a blog web app that allows users to create articles. Once a user clicks on 'new article', they will be taken to a page with a 'post article' button. This button triggers a post request linked to my ...

Discover the best methods for accessing all pages on a Facebook account

I attempted to retrieve a list of all Facebook pages, but encountered an error. The error message states: 'request is not defined.' Here is the code snippet: var url = 'https://graph.facebook.com/me/accounts'; var accessToken = req.u ...

NodeJS domain error handling failing to catch ReferenceError exceptions

I'm currently facing some challenges with domains in NodeJS. I've set up middleware functions to wrap every call in my web application within a domain in order to capture errors, process them, and return informative error messages. While this se ...

Enhancing react-confirm-alert: Steps to incorporate your personalized CSS for customizing default settings

I'm currently utilizing a confirmation popup feature provided by react-confirm-alert: popup = _id => { confirmAlert({ title: "Delete user", message: "Are you sure?", buttons: [ { label: ...

assigning attributes to web addresses

Is there a way to set a style property for webpages by targeting addresses that contain /index.php/projecten/ instead of specifying each complete address in the code? Currently, I am using the following code: <ul class="subnavlist" style="display: &l ...

Separating stylesheets, head, and other elements in a curl response

After successfully using curl to retrieve an external site, I noticed that the results were interfering with my own content. The CSS from the external site was affecting my webpage's layout and z-index values were conflicting. I am seeking a solution ...

What is the best way to elegantly display a block containing background and text using Angular and ngAnimate?

I'm a beginner when it comes to JavaScript and Angular. I am attempting to use ng-show and ng-hide for my background and text elements. However, I am experiencing an issue with my text: It smoothly hides, but when it is shown again, the text appears b ...

Is it possible to show one element while hiding others upon clicking using JavaScript?

Concept My idea is to create a website with a navigation menu where only one section is visible at a time. Each section would become visible upon clicking a specific button in the navigation bar. Challenge I attempted to achieve this using the following ...