Here is my data source:
var gridDataSource = new kendo.data.DataSource({
data: orderData,
schema: {
model: {
fields: {
Blank: { type: "string" },
ERevisionsUpdated: { type: "string" },
TIMOrderNumber: { type: "number" },
TBContractNumber: { type: "string" },
NccOrderNumber: { type: "string" },
AEName: { type: "string", },
OrderOriginalGross: { type: "number" },
ClientName: { type: "string" },
AgencyId: { type: "string" },
AgencyName: { type: "string" },
OrigMonthlyGross: { type: "number" },
TIMGross: { type: "number" },
TIMVariance: { type: "number" },
TIMWhole: { type: "string" },
TnBGross: { type: "number" },
TnBVariance: { type: "number" },
TnBWholePercent: { type: "number" },
Clearance: { type: "string" },
StartDate: { type: "date" },
EndDate: { type: "date" },
Market: { type: "string" },
LatestTimNote: { type: "string" },
TrafficSystemId: { type: "number" }
}
}
},
aggregate: [
{ field: "TnBGross", aggregate: "average" }
],
pageSize: 10,
sort: {
field: "TIMOrderNumber",
dir: "asc"
}
});
Here is the grid:
$("#ordersGrid").kendoGrid({
selectable: true,
allowCopy: true,
toolbar: ["excel", "pdf", "search"],
pdf: {
allPages: true
},
resizable: true,
//noRecords: {
// template: "No Records Found! Click search to query for records."
//},
excel: {
allPages: true
},
columnMenu: false,
columns: [
{ command: { text: "Dropped Spots", click: showDetails }, title: " ", width: "125px" },
{ command: { text: "SET", click: showDetails }, title: " ", width: "85px" },
{ field: "ERevisionsUpdated", title: "eRevision Status", width: "135px" },
{ field: "TIMOrderNumber", title: "TIM Order #", width: "114px", minResizableWidth: 100 },
{ field: "TrafficSystemId", title: "Traffic Id #", width: "100px", minResizableWidth: 80 },
{ field: "Revision", title: "Revision Info", width: "114px", minResizableWidth: 80 },
{ field: "TBContractNumber", title: "TB Contract #", width: "121px" },
{ field: "NccOrderNumber", title: "NCC Order #", width: "114px" },
{ field: "AEName", title: "AE Name", width: "150px" },
{ field: "ClientName", title: "Client Name", width: "275px", minResizableWidth: 150 },
{ field: "AgencyId", title: "Agency Id", width: "275px", minResizableWidth: 150 },
{ field: "AgencyName", title: "Agency Name", width: "275px", minResizableWidth: 150 },
{ field: "OrderOriginalGross", title: "Order Original Gross", format: "{0:c}", width: "154px" },
{ field: "OrigMonthlyGross", title: "Orig. Monthly Gross", format: "{0:c}", width: "150px" },
{ field: "TIMGross", title: "TIM Gross", format: "{0:c}", width: "120px" },
{ field: "TIMVariance", title: "TIM Variance", format: "{0:c}", width: "121px" },
{ field: "TIMWhole", title: "TIM Whole %", template: TIMWholeFunction, width: "115px" },
{ field: "TnBGross", title: "T&B Gross", format: "{0:c}", width: "100px", footerTemplate: "" },
{ field: "TnBVariance", title: "T&B Variance", format: "{0:c}", width: "115px" },//, aggregates: ["average"], footerTemplate: "Average: #=average#"},
{ field: "TnBWholePercent", title: "T&B Whole %", template: '#=kendo.format("{0:p}", TnBWholePercent / 100)#', width: "121px" },
{ field: "Clearance", title: "Clearance Rate %", width: "147px" }, //template: '#=kendo.format("{0:p}", Clearance / 100)#',
{ field: "StartDate", title: "Start", template: startDateFunction, width: "90px" },
{ field: "EndDate", title: "End", template: endDateFunction, width: "90px" },
{ field: "Market", title: "Market", width: "175px" },
{ field: "LatestTimNote", title: "Latest TIM Note", width: "800px" }
//{ field: "TrafficSystemId", hidden: true }
],
filterable: {
extra: false
},
sortable: true,
groupable: false,
pageable: {
pageSize: 10,
alwaysVisible: true,
buttonCount: 5,
refresh: false,
pageSizes: true
},
change: onGridChange,
dataSource: gridDataSource,
rowTemplate: '<tr class=\"#=GetRowColorValue(StartDate, EndDate)#\" data-uid="#= uid #"><td role="gridcell"> <a class="k-button" href=\"#=GetDroppedSpotsLink(TIMOrderNumber, TrafficSystemId)#\" target="_blank">Dropped Spots</a> </td><td role="gridcell"> <a class="k-button" href=\"#=GetSetLink(TBContractNumber, AreaId)#\" target="_blank">SET</a> </td><td role="gridcell" class=\"\"><img src=\"#:GetERevImage(ERevisionsUpdated)#" height=20 width=20></td><td role="gridcell"> <a href=\"#=GetTimOrderLink(TIMOrderNumber)#\" target="_blank">#:TIMOrderNumber#</a> </td><td role="gridcell"><a class="k-button" onclick="GetTrafficSystem(#=TrafficSystemId#)" target="_blank">#: TrafficSystemId #</a> </td><td role="gridcell" ><span class="\" onclick="GetRevisionInfo(#=TIMOrderNumber#)" target="_blank"><img src=\/Content\/images\/Exclamation.svg.png height=20 width=20></span></td><td role="gridcell">#: TBContractNumber #</td><td role="gridcell">#:NccOrderNumber#</td><td role="gridcell">#: AEName #</td><td role="gridcell">#: ClientName #</td><td role="gridcell">#: GetAgencyId(AgencyId) #</td><td role="gridcell">#: AgencyName #</td><td role="gridcell">#= GetOrderOriginalGross(OrderOriginalGross) #</td><td role="gridcell">#: GetOriginalMonthlyGross(OrigMonthlyGross) #</td><td role="gridcell">#: GetTIMGross(TIMGross) #</td><td role="gridcell">#: GetTIMVariance(TIMVariance) #</td><td role="gridcell" class=\"#=GetTimWholeColorValue(TIMWhole)#\" >#: GetTIMWhole(TIMWhole) #</td><td role="gridcell">#: GetTnBGross(TnBGross) #</td><td role="gridcell">#: GetTnBVariance(TnBVariance) #</td><td role="gridcell" class=\"#=GetTnBWholeColorValue(TnBWholePercent)#\">#: GetTnBWholePercent(TnBWholePercent) #</td><td role="gridcell">#:GetClearanceValue(Clearance)#</td><td role="gridcell">#=startDateFunction(StartDate) #</td><td role="gridcell">#=startDateFunction(EndDate) #</td><td>#: Market #</td><td role="gridcell"><a href=\"#=GetTimNoteLink(TimSystemId, TIMOrderNumber)#\" target="_blank">#: LatestTimNote #</a></td></tr>'
});
The field TnBGross has footerTemplate value = "". i.e. empty string. This works fine. However if you insert anything, even a space like " ", then grid breaks. What could be going wrong here?
Thank You!
Please help me to find what is wrong in here...