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

[Solved] Grid - Client data binding?

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cuong
Top achievements
Rank 1
Cuong asked on 15 Mar 2012, 10:15 AM
Hi there.

I have below problem with grid, wonder someone can help?

Here the scenario:
User click into a button, an ajax request is sent to controller, and a json data response is sent back.
I want use that response data to fill into a grid.
Here is my sample code:

The button:
<input type="button" onclick="onClick()" value = "Click me"/>

Javascript code:

<script type="text/javascript">
    function onClick() {
        $.post("/Home/_AjaxTestSearching", {
            isDelete: false
        }, function (responseData) {
            var grid = $("#ListGrid").data("tGrid");
            // something to do with responseData here
            // to set it into grid
        });
    }
</script>

Any helps?
Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Cuong
Top achievements
Rank 1
answered on 15 Mar 2012, 10:36 AM
Hi.
I've already found what I need.
It's: grid.dataBind(data);
Tags
Grid
Asked by
Cuong
Top achievements
Rank 1
Answers by
Cuong
Top achievements
Rank 1
Share this question
or