Refresh Kendo UI grid data by reading variable


XIMRX

The grid reads data from javascript variables.

    $("#grid").kendoGrid({
    dataSource: {
        type: "text",
        data: jsvar,
        schema: {
            model: {
                fields: {
                    id: {type: "string", editable: false},
                    name: {type: "string"}
                }
            }
        },
        pageSize: 20
    },
    pageable: {
        input: true,
        numeric: true
    },
   //toolbar: [{text: "Add"}],
    columns: [
        {command: [{text: "Edit", click: showDetailse}, {text: "View", click: viewoneitm}], title: " ", width: "170px"},


    ]
});

Then I change the value of this variable jsvar with ajax and wait for the ajax response and then use

            jQuery("#grid").data("kendoGrid").dataSource.read();
            jQuery("#grid").data("kendoGrid").refresh();

The grid is not repopulated with new data, while the old data remains in the grid. Please tell me how to refresh grid data. This works fine and the grid refreshes perfectly until I serve static data, but after I use ajax and then "refresh" it fails to update

Lars Höppner

If jsvaran array is included, the Kendo data source will create a model for each array item, so if you modify the original array, the data source will not be changed. If you want to change the data, you should do it like this:

grid.dataSource.data(jsvar);

Related


Kendo UI MVVM grid refresh/reload

Nick S These solutions ( reload/refresh Kendo grid ) $('#GridName').data('kendoGrid').dataSource.read(); $('#GridName').data('kendoGrid').refresh(); Doesn't work for Kendo MVVM grid. Specifically $('#GridName'). data('kendoGrid') returns 'undefined'.

Kendo UI MVVM grid refresh/reload

Nick S These solutions ( reload/refresh Kendo grid ) $('#GridName').data('kendoGrid').dataSource.read(); $('#GridName').data('kendoGrid').refresh(); Doesn't work for Kendo MVVM grid. Specifically $('#GridName'). data('kendoGrid') returns 'undefined'.

How to refresh the Kendo grid with new data

Tom S After the kendo grid is loaded, I want to refresh/reload the grid with new data by clicking a button. Controller: using Kendo.Mvc; using Kendo.Mvc.Extensions; using Kendo.Mvc.Infrastructure; using Kendo.Mvc.UI; public ActionResult Fo

Sort Grid data in Kendo UI Grid

Masood I want to sort the retrieved data to the description field, but I can't sort it. UI code: Display data correctly var gridDataSource = new kendo.data.DataSource({ autoSync: true, data: transformation.Activities, schema: { model: {

How to refresh the grid after editing the Kendo UI grid?

flower I edit the grid editable: "popup" using the way shown on Telerik's demo page . After editing the grid, I want the grid to refresh. After editing the grid, does the grid have any events that are called? I am trying to use data binding events. In this cas

Kendo grid not highlighting selected row / missing ui refresh

other I have a kendo grid: <kendo-grid [data]="gridData" [pageSize]="state.take" [skip]="state.skip" [sort]="state.sort" [filter]="state.filter" [sortable]="true" [pageable]="true" [filterable]="true" [kendoGridSelectBy]="'guid'" [selectable]="true" [selected

Kendo UI grid header disappears/moves on page refresh

Divya Sankaran I have a kendoui grid populated from a json data source. Whenever my page reloads and I refresh the grid, I see the headers move to the left and the rightmost column has no headers! Has anyone seen this question? I can't find an answer on SO for

Kendo UI grid header disappears/moves on page refresh

Divya Sankaran I have a kendoui grid populated from a json data source. Whenever my page reloads and I refresh the grid, I see the headers move to the left and the rightmost column has no headers! Has anyone seen this question? I can't find an answer on SO for

How to refresh grid datasource using angular Kendo UI

David Kessel I am using the Angular Kendo UI project to combine Telerik Kendo grid with Angular. I have the following markup: <div kendo-grid="" k-options="thingsOptions" style="height: 600px;" /> and the following code in my controller: $scope.thingsOpti

Reload/refresh Kendo grid

Oxon How to reload or refresh Kendo Grid using Javascript? Often the grid needs to be reloaded or refreshed after a certain time or user action. Jamin you can use it $('#GridName').data('kendoGrid').dataSource.read(); <!-- first reload data source --> $('#Gr

Reload/refresh Kendo grid

Rabegui I need to reload all grids (not only data). I am trying: $('#GridName').data('kendoGrid').dataSource.read(); $('#GridName').data('kendoGrid').refresh(); But read()just reloading the data and refresh()not working. When the user clicks the button, I nee

Reload/refresh Kendo grid

Oxon How to reload or refresh Kendo Grid using Javascript? Often the grid needs to be reloaded or refreshed after a certain time or user action. Jamin you can use it $('#GridName').data('kendoGrid').dataSource.read(); <!-- first reload data source --> $('#Gr

Reload/refresh Kendo grid

Rabegui I need to reload all grids (not only data). I am trying: $('#GridName').data('kendoGrid').dataSource.read(); $('#GridName').data('kendoGrid').refresh(); But read()just reloading the data and refresh()not working. When the user clicks the button, I nee

Reload/refresh Kendo grid

Oxon How to reload or refresh Kendo Grid using Javascript? Often the grid needs to be reloaded or refreshed after a certain time or user action. Jamin you can use it $('#GridName').data('kendoGrid').dataSource.read(); <!-- first reload data source --> $('#Gr

Reload/refresh Kendo grid

Rabegui I need to reload all grids (not only data). I am trying: $('#GridName').data('kendoGrid').dataSource.read(); $('#GridName').data('kendoGrid').refresh(); But read()just reloading the data and refresh()not working. When the user clicks the button, I nee

Unable to bind data using Kendo ui grid

Natalaran Nagarazugari This is my action method public ActionResult Kendo([DataSourceRequest]DataSourceRequest request ) { var emp = EmployeeManager.GetAllEmployees(); DataSourceResult result = emp.ToDataSourceResult(request); ret

Kendo UI Grid, sorting data source groups

Ben Cameron I have a page with a kendo grid on it. It is calling ajaz web request to get its data. After the data is returned, it will be grouped on the front end. The problem I'm having is sorting the groups. What's the best way to do this? My MVC view code l

Export data from Kendo-UI grid

User 1451111 The KendoUI grid code in my app is declarative like this: <kendo-grid id="myGrid" options="mainGridOptions"> <kendoGridToolbarTemplate> <button kendoGridExcelCommand>Export to Excel</button> <kendo-grid-excel fileName="Gri

kendo ui grid data not showing from php

username I want to display data into my kendo grid. I am using basic php mysql to return results from database. Here is my kendo javascript code. <script> $(document).ready(function () { $("#grid").kendoGrid({ dataSource: {

Unable to bind data using Kendo ui grid

Natalaran Nagarazugari This is my action method public ActionResult Kendo([DataSourceRequest]DataSourceRequest request ) { var emp = EmployeeManager.GetAllEmployees(); DataSourceResult result = emp.ToDataSourceResult(request); ret

Kendo UI Grid pass data to another form

Nixon I have this demo related to my situation , how to bind additional data dataSourceinto my popup form. If, a popup form will appear outletType = rest. thanks for your help. Dojo Demo don't vote for me You don't need to set extra data , data from all data s

How to manually load data in Kendo UI grid

Taversi I have a kendo ui grid. I want to load the grid manually. For example, when my page loads, the grid doesn't load, but when I click the button, the data loads into the grid. what should I do? thanks. Johnny Hong Kong Automatic loading from the grid's da

Kendo UI, grid, modify data before sending

Internet duvet Is it possible to access and modify data in the Kendo UI grid before updating? Below is an example to illustrate what I need. There is no real convenient form in options.datacontaining the sent data, but it has been formatted as a string ."model

Kendo UI Grid select by data item

ablago I have a Kendo UI grid with a large data source and paging. I have an event that fires where I know the underlying data item to be selected, but not sure how to paginate/select the item in the grid programmatically. If the item is not on the current gri

Create a basic data grid with Kendo UI and AngularJS

Node newbie I am trying out AngularJS. I want to show a basic kendo grid. I am trying to do this using pure directives. With that in mind, I looked into the Kendo UI/Angular JS project ( https://github.com/kendo-labs/angular-kendo ). Unfortunately, my index.ht