Kendo grid refresh issue in mobile

Gunaseelan

I refresh the kendo grid for every 10 seconds, I used following code and I used the kendo.all.min.js

$(document).ready(function () {
            loadData();
            intervalManager(true, TableStatus, 10000);
        });
        var TableStatus = function () {
            loadData();
        }
        var refreshorderplacedgrid;
        function intervalManager(flag, animate, time) {
            if (flag)
                refreshorderplacedgrid = setInterval(animate, time);
            else
                clearInterval(refreshorderplacedgrid);
        }
        function loadData() {
            var grid = $("#grid").kendoGrid({
                dataSource: {
                    data: [
                            { ID: '1001', FirstName: 'Alphy', LastName: 'LastName', category: 'A', Markable: true },
                            { ID: '1002', FirstName: 'Betty', LastName: 'LastName', category: 'B', Markable: true}],
                    schema: {
                        model: {
                            fields: {
                                FirstName: { type: "string" },
                                LastName: { type: "string" }
                            }
                        }
                    },
                    sort: {
                        field: "FirstName",
                        dir: "asc"
                    },
                    pageSize: 10
                },
                scrollable: true,
                sortable: true,
                selectable: true,
                columns: [
                {
                    field: "FirstName",
                    title: "First Name"
                },
                {
                    field: "LastName",
                    title: "Last Name"
                },
                { template: kendo.template($("#isCancel-template").html()) }
            ]
            }).data("kendoGrid");
        }

This code gives me the output like following screenshot in system chrome,

enter image description here

But in mobile [All devices]

It appends with the old grid, instead of rebinding like following screenshot

enter image description here

I dont know what is problem here, I have googled and used $("#grid").data("kendoGrid").refresh(); this code too. Nothing happend, Any help will be highly appreciable.

Thanks, Guna

Gunaseelan

@gitsitgo 's comment, I changed the code as following way, for avoid the re initialization of the grid, and now its working fine.

var myDataSource = new kendo.data.DataSource({
        data: [
                        { ID: '1001', FirstName: 'Alphy', LastName: 'LastName', category: 'A', Markable: true },
                        { ID: '1002', FirstName: 'Betty', LastName: 'LastName', category: 'B', Markable: true },
                        { ID: '1003', FirstName: 'Betty', LastName: 'LastName', category: 'B', Markable: true}],
        schema: {
            model: {
                fields: {
                    FirstName: { type: "string" },
                    LastName: { type: "string" }
                }
            }
        },
        sort: {
            field: "FirstName",
            dir: "asc"
        },
        pageSize: 10
    });

    $(document).ready(function () {
        initGrid();
        loadData();
        intervalManager(true, TableStatus, 10000);            
    });
    var TableStatus = function () {
        loadData();
    }
    var refreshorderplacedgrid;
    function intervalManager(flag, animate, time) {
        if (flag)
            refreshorderplacedgrid = setInterval(animate, time);
        else
            clearInterval(refreshorderplacedgrid);
    }
    function loadData() {
        $("#grid").data("kendoGrid").setDataSource(myDataSource);
        $("#grid").data("kendoGrid").refresh();
    }
    function initGrid() {
        var grid = $("#grid").kendoGrid({
            dataSource: myDataSource,
            scrollable: true,
            sortable: true,
            selectable: true,
            columns: [
            {
                field: "FirstName",
                title: "First Name"
            },
            {
                field: "LastName",
                title: "Last Name"
            },
            { template: kendo.template($("#isCancel-template").html()) }
        ]
        }).data("kendoGrid");
    }

Thanks, Guna

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

kendo grid do not refresh on update

From Dev

Template issue Kendo mobile, maybe

From Dev

Kendo Grid: Toolbar template issue

From Dev

Kendo Heirarchical Grid Alignment Issue

From Dev

Kendo Grid: Toolbar template issue

From Dev

Kendo Grid editable row issue

From Dev

Kendo Mobile - Can not refresh listview on ModalView Close

From Dev

Kendo Mobile - Can not refresh listview on ModalView Close

From Dev

Cannot refresh Kendo Grid by a custom button?

From Dev

Refresh after update Telerik Kendo Grid (MVC)

From Dev

Refresh Kendo UI grid data by reading a variable

From Dev

Kendo grid cell refocusing after refresh

From Dev

Kendo Grid datasource refresh does not work in IE

From Dev

Refresh Kendo UI grid data by reading a variable

From Dev

Kendo Ui opensource Grid not refresh in Internet Explorer?

From Dev

kendo grid refresh doesnt work with crm dynamics

From Dev

Kendo UI MVVM Grid Refresh/Reload

From Dev

How to refresh kendo grid with new data

From Dev

Cannot refresh kendo grid on button click in angularjs

From Dev

Is the Kendo UI Web Grid adaptive rendering independent of the Kendo mobile application?

From Dev

Kendo ui mobile splitview navigation issue

From Dev

Kendo grid number formatting as percentage issue

From Dev

Positioning issue with kendo ui tooltip inside a grid

From Dev

Kendo Grid inside Jquery Dialog with modal Issue

From Dev

Kendo grid format time issue in date column

From Dev

Kendo UI grid: radio button and pagination issue

From Dev

Kendo Ui Grid Date time Convertion Issue

From Dev

Uncaught object error Kendo grid read issue

From Dev

Date format issue in Kendo Grid with inline editing

Related Related

HotTag

Archive