This is a migrated thread and some comments may be shown as answers.

footerTemplate not rendering unless its empty string

3 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
uadeeb
Top achievements
Rank 1
uadeeb asked on 09 Jun 2020, 03:09 AM

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...

3 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 10 Jun 2020, 08:16 PM

Hi Umar,

Can you give me more details about how the Grid "breaks" when defining the footer template with an empty string? Is it its layout that is not correctly displayed? Or are there any errors in the browser's console?

Please provide more details so we can further investigate what is the reason for the issue. I can't see anything incorrect in the shared code snippets. If it is possible, can you provide a runnable example or a Dojo project in which the reported behavior can be replicated?

Regards,
Petar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
uadeeb
Top achievements
Rank 1
answered on 11 Jun 2020, 02:35 AM

Hi Petar,

If its empty all is OK.

However if I try to put in some text  e.g. footerTemplate: "xyz" then it does not render and javascript stops at that point and throws and error and all subsequent actions are stopped. 

0
Petar
Telerik team
answered on 12 Jun 2020, 10:36 AM

Hi,

Can you share the browser errors that you get? Based on them I will have more details about the issue. 

Also, can you replicate the issue in a Dojo project and send it to me? 

Regards,
Petar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
uadeeb
Top achievements
Rank 1
Answers by
Petar
Telerik team
uadeeb
Top achievements
Rank 1
Share this question
or