Hi,
I have a grid with transport.read.data specified to a javascript function to call. This isn't working as it doesn't ever call the function in javascript. Any help here would be great.
$("#mailingListGrid").kendoGrid({
dataSource: {
autoBind: false,
transport: {
read: "@Url.Action("GetCustomersJson", "MailingList")",
type: "jsonp",
data: additionalData
},
pageSize: 40,
schema: {
id: "KeyCustomer",
model: {
fields: {
CustomerName: { field: "CustomerName", type: "string" },
CustomerContact: { field: "CustomerContact",type: "string" },
ShipAddress1: { field: "ShipAddress1",type: "string" },
ShipCity: { field: "ShipCity",type: "string" },
ShipState: { field: "ShipState",type: "string" },
ShipZipCode: { field: "ShipZipCode",type: "number" },
IsShipTo: { field: "IsShipTo",type: "number" },
IsBillTo: { field: "IsBillTo",type: "number" },
KeySalesOrg: { field: "KeySalesOrg",type: "number" },
KeySendBillsTo: { field: "KeySendBillsTo",type: "number" },
DoubleUnitsBooked: { field: "DoubleUnitsBooked",type: "number" },
SingleUnitsbooked: { field: "SingleUnitsBooked",type: "number" }
}
}
}
},
height: 550,
sortable: true,
noRecords: {
template: "Please Select a Name to continue"
},
pageable: true,
selectable: false,
columns: [{
template: "<div" +
"style='');'><input class='checkboxSelector' type=\"checkbox\"/></div>",
field: 'field', headerTemplate: "<input id='checkboxHeader' onclick='checkAll()' type='Checkbox'/>",
width: 50,
sortable: false,
}, {
field: "CustomerName",
title: "Customer Name",
width: 240
}, {
field: "ShipAddress1",
title: "Address"
}, {
field: "ShipCity",
title: "City"
}, {
field: "ShipState",
title: "State",
width: 150
}, {
field: "ShipZipCode",
title: "Zip Code"
}],
change: function (e, args) {
var grid = e.sender;
var items = grid.items();
items.each(function (idx, row) {
var idValue = grid.dataItem(row).get(idField);
if (row.className.indexOf("k-state-selected") >= 0) {
selectedOrders[idValue] = true;
} else if (selectedOrders[idValue]) {
delete selectedOrders[idValue];
}
});
},
dataBound: function (e) {
var grid = e.sender;
var items = grid.items();
var itemsToSelect = [];
items.each(function (idx, row) {
var dataItem = grid.dataItem(row);
if (selectedOrders[dataItem[idField]]) {
var currentRow = grid.tbody.find("tr[data-uid='" + dataItem.uid + "']");
currentRow.toggleClass('k-state-selected');
currentRow.find('input:checkbox').prop('checked', 'checked');
itemsToSelect.push(row);
};
});
//e.sender.select(itemsToSelect);
},
});
function additionalData() {
var value = $("#dsmList").data("kendoDropDownList").value();
return { dsm: value };
};
Not sure what exactly is going wrong here. Any help is appreciated.