Hi everyone,
I’m using version 3.5 and trying to bind data to grid dynamically but it didn’t work as expected.
– Initiate the grid without data
– Click button to get data from server and bind data in the same time
– Bind data with codes following:
$(“#reportData”).click(function () {
test();
});
function test()
{
var mfromDate = $(“#jqxFromDate”).val();
var mtoDate = $(“#jqxToDate”).val();
var getUrl = ‘@Url.Action(“rptNSDetail”, “ReportList”)’;
$.ajax(getUrl, {
type:’GET’,
data: {fromDate: mfromDate, toDate: mtoDate},
success: function(d){
var sourceNS001 =
{
localdata: @Html.Raw(ViewBag.rptNS001),// Html.Raw(ViewBag.rptNS001): data received from server
datatype: “array”
};
var dataAdapter = new $.jqx.dataAdapter(sourceNS001);
dataAdapter.dataBind();
}
}
}
But nothing happened.
Maybe I did something wrong. Please, help me! So many thanks to you.
P.S: I’m sure of having data from server before binding data