This is a migrated thread and some comments may be shown as answers.

Grid ajax/jquery refresh

3 Answers 1578 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stany
Top achievements
Rank 1
Stany asked on 14 Jun 2012, 06:59 AM
Is it possible to reload the grid through jQuery?
In Telerik Grid this could be done by firing the $("#grid").data("tGrid").AjaxRequest(), and all filters and sortings would stay as they were, but the records would be refreshed.
This would help my out tremendously, thanks!

3 Answers, 1 is accepted

Sort by
0
Stany
Top achievements
Rank 1
answered on 14 Jun 2012, 07:14 AM
Experimenting did the trick: $("#grid").data("kendoGrid").dataSource.read();
0
Mark
Top achievements
Rank 1
answered on 06 Aug 2012, 03:23 PM

How do I reload the data in an ajax bound grid?

The read method of the DataSource should be used.

Example: Reload Ajax Bound Grid

var grid = $("#Grid").data("kendoGrid");

grid.dataSource.read();
0
Cristian
Top achievements
Rank 1
answered on 29 Aug 2012, 09:56 PM
Good Afternon a have a problem I want to refresh a grid with jquery ajax and i can not. my code is like:

$('#btnFilter).on('click', function(e){
e.preventDefault();
var grid = $("#grid").data("kendoGrid");
var new_data = getData();
grid.dataSource.data(new_data);
});

function getData() {
    var _resData;
    var name= $('#txtName').val();
    $.ajax({
        type: 'POST',
        url: '/product/list/',
        dataType: 'json',
        data: { name: name},
        success: function (data) {
            _resData = data; 
        },
        data: {},
        async: false
    });
    return _resData;
}
Tags
Grid
Asked by
Stany
Top achievements
Rank 1
Answers by
Stany
Top achievements
Rank 1
Mark
Top achievements
Rank 1
Cristian
Top achievements
Rank 1
Share this question
or