1. ajax请求
$.ajax({
type: "post",url: "ChartData",
dataType: "json",
data: { section: section, index: index },//,year: year
success: function (data) {
console.info(data.result);
bindChart(data.result[0].SectionName, data.times, data.polldata);
}
});
}
2.public virtual string Action(string actionName);
var fanwei = $("#fanwei").combobox("getValue");
var year = $("#time").combobox("getValue");
$("#dt_dayw").mapuni_datagrid({
url: "@Url.Action("getWaterLoad")?fanwei="+fanwei+"&year="+year,
//data:_gridData,
pagination: true,
rownumbers: false,
onLoadSucess: function (result) {
data = result;
},
});
3.传递参数的方式queryParams
$("#dt_dayw").mapuni_datagrid({
url: "@Url.Action("getWaterLoad")" ,
//?fanwei=+ fanwei + "&year=" + year
//data:_gridData,
queryParams: {
fanwei: fanwei,
year: year,
},
pagination: true,
rownumbers: false,
onLoadSucess: function (result) {
debugger;
data = result;
},
});