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

Kendo UI grid not populating the data

1 Answer 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mathew
Top achievements
Rank 1
Mathew asked on 20 Feb 2013, 08:04 AM
I am working on VS 2010 MVC4, HTML 5 with kendo ui demo version
I tried to bind a grid, corresponding to the data entered in a textbox, but the grid is not getting populated

Also there is no error displayed and if i put a dummy data in datasource it displays
 This is the code i used

$("#txtSearchCaller").keyup(function () { SearchCaller($(this)); });

function SearchCaller(txtSearchCaller) {
            SearchRequestProcess = $.ajax({
            type: "GET",
            url: baseURL + "Call/SearchCaller",
            data: "term=" + $(txtSearchCaller).val(),
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: OnGetCallerSuccess,
            error: function (request, status, error) { if (request.statusText != "abort") { alert("SearchCaller:: " + request.statusText); } }
                });
    }
}
function OnGetCallerSuccess(Jsondata, status) {
    $("#Grid").kendoGrid({ // create Grid from div HTML element Kendo
        dataSource: Jsondata,
        selectable: "row",
        scrollable: true,
        navigatable: true,
        resizable: true,
        groupable: false,
        columns: [
                    {
                        field: "category1",
                        title: "category1",
                        width: 80
                    },
                    {
                        field: "category2",
                        title: "Customer Name",
                        width: 80
                    },
                ]
    });
}

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 22 Feb 2013, 09:25 AM
Hello Mathew,

First of all I do not recommend you  to re-create your Grid  each type you type into an input element - you can just change the data used by the dataSource.
We are not sure what exactly goes wrong with your code, however I re-created similar example to your, the difference is that there is no async call, however there should not be any difference.

http://jsbin.com/acujat/3/edit

Feel free to modify the link and share it if you face any particular difficulties.

Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Mathew
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or