8
« on: May 22, 2014, 09:04:30 pm »
Thanks for this... I have simple MVC 5 app created with VS2013
Seems issue is bit different that my controller function is not called, so firstly i check with simple jquery ajax call
$(function () {
$.ajax({
type: "GET",
url: "/Home/TestAjaxcall",
success: function (result) {
$('#paramqrytest').html(result);
},
error: function (req, status, error) {
alert("Coudn't load partial view");
}
})
});
and here is my controler function
public ActionResult TestAjaxcall()
{
int test;
test = 56;
return Content("This is poorly formatted text.", "text/text");
}
i have inserted the break point that on test =56; for testing that weather function executes or not.. and it is fine and displaying the string on web page.
But when i change the script as
<script>
$(function () {
var colM = [
{ title: "Order ID", width: 100, dataIndx: "OrderID" },
{ title: "Customer Name", width: 130, dataIndx: "CustomerName" },
{ title: "Product Name", width: 190, dataIndx: "ProductName" },
{ title: "Unit Price", width: 100, dataIndx: "UnitPrice", align: "right" },
{ title: "Quantity", width: 100, dataIndx: "Quantity", align: "right" },
{ title: "Order Date", width: 100, dataIndx: "OrderDate" },
{ title: "Required Date", width: 100, dataIndx: "RequiredDate" },
{ title: "Shipped Date", width: 100, dataIndx: "ShippedDate" },
{ title: "ShipCountry", width: 100, dataIndx: "ShipCountry" },
{ title: "Freight", width: 100, align: "right", dataIndx: "Freight" },
{ title: "Shipping Name", width: 120, dataIndx: "ShipName" },
{ title: "Shipping Address", width: 180, dataIndx: "ShipAddress" },
{ title: "Shipping City", width: 100, dataIndx: "ShipCity" },
{ title: "Shipping Region", width: 110, dataIndx: "ShipRegion" },
{ title: "Shipping Postal Code", width: 130, dataIndx: "ShipPostalCode" }
];
var dataModel = {
location: "remote",
dataType: "JSON",
method: "GET",
url: "/Home/TestAjaxcall",
getData: function (dataJSON) {
return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: dataJSON.data };
}
}
$("#paramqrytest").pqGrid({
width: 900, height: 400,
dataModel: dataModel,
colModel: colM,
freezeCols: 2,
pageModel: { type: "remote", rPP: 20, strRpp: "{0}" },
sortable: false,
wrap: false, hwrap: false,
numberCell: { resizable: true, width: 30, title: "#" },
title: "Shipping Orders",
resizable: true
});
});
</script>
application not stopping on break point but runs and show just column names (as i am not displaying anything in data..)