Kanban card template issue

I am using kanban view in my project. Also used card settings with template, like,
cardSettings: {
headerField: "Id",
template: function() {
return { template: cardTemplate };
}
},
but getting blank on my end, ie no data displayed.  

Used Ref links: 
1. https://github.com/syncfusion/ej2-vue-samples/blob/master/src/kanban/card-template.vue
2. https://ej2.syncfusion.com/vue/demos/?_ga=2.178723106.723451742.1599133796-662199164.1583131897#/material/kanban/card-template.html
With the help of above URLs, I implemented this in my project folder. 

When I am fetching simple data without card template like,
cardSettings: { contentField: "Summary", headerField: "Id", }
It's works good.
Please help on this, without template I cant customised my UI structure. I attached my files as zip.


Attachment: kanban_1c1a505a.zip

29 Replies

HB Hareesh Balasubramanian Syncfusion Team September 4, 2020 02:03 PM UTC

Hi Somsubhra, 

Greetings from Syncfusion Support..!                                                                           

We have validated your shared code snippet and shared query “I am using kanban view in my project. Also used card settings with template, like, but getting blank on my end, ie no data displayed” at our end. And we suspect that your requirement is to customize the Kanban cards like KanbanCardTemplateSample and for that, we have prepared a sample and it can be downloaded from the following link. 


Kindly try the above solution and get back to us if you need any further assistance. 
 
Regards, 
Hareesh 



UN Unknown Syncfusion Team September 8, 2020 11:59 AM UTC

Hi Hareesh,

Thanks for your response. 
I tested your sample code, but same thing happened on my end. Also on Syncfusion portal (https://ej2.syncfusion.com/vue/documentation/kanban/cards/#template), data didn't listed. 

Shared my code again and also both screenshot of my end as well as Syncfusion as attach.

Also find a error, when click on another where (kanban to list icon) from kanban view (Not when load kanban view) - 
client.js?06a0:96 TypeError: Cannot read property '0' of undefined
    at DragAndDrop.unWireDragEvents (drag.js?10a0:506)
    at LayoutRender.unWireDragEvent (layout-render.js?e989:777)
    at LayoutRender.unWireEvents (layout-render.js?e989:763)
    at LayoutRender.destroy (layout-render.js?e989:782)
    at Kanban.destroyModules (kanban.js?277c:356)
    at Kanban.destroy (kanban.js?277c:547)
    at VueComponent.ComponentBase.beforeDestroy (component-base.js?993c:72)
    at invokeWithErrorHandling (vue.common.dev.js?4650:1859)
    at callHook (vue.common.dev.js?4650:4216)
    at VueComponent.Vue.$destroy (vue.common.dev.js?4650:3975)

Please guide. 

Regards,
Somsubhra

Attachment: smaple_test_d079d275.zip


HB Hareesh Balasubramanian Syncfusion Team September 8, 2020 01:10 PM UTC

Hi Somsubhra, 

Thanks for the update. 

We have validated your SharedLink at our end and we are able to replicate the issue on our side and in that, we have made the data function as an empty function that could be the reason for the reported problem. And for that, we will modify our UG sample and it will be reflected in our upcoming release, and in the meantime, we suggest you please use the below-modified code snippet to overcome this issue. 


Code snippet: 
Old snippet 
Modified snippet 
template: function() { 
  return { 
  template: Vue.component('cardTemplate', { 
                template: `<div class='e-card-content'> 
                                                                <table class="card-template-wrap"> 
                                                                                <tbody> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Id:</td> 
                                                                                                                <td>{{data.Id}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Type:</td> 
                                                                                                                <td>{{data.Type}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Priority:</td> 
                                                                                                                <td>{{data.Priority}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Summary:</td> 
                                                                                                                <td>{{data.Summary}}</td> 
                                                                                                </tr> 
                                                                                </tbody> 
                                                                </table> 
                                                </div>`, 
                data() { } 
  }) 
template: function() { 
  return { template: Vue.component('cardTemplate', { 
                template: `<div class='e-card-content'> 
                                                                <table class="card-template-wrap"> 
                                                                                <tbody> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Id:</td> 
                                                                                                                <td>{{data.Id}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Type:</td> 
                                                                                                                <td>{{data.Type}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Priority:</td> 
                                                                                                                <td>{{data.Priority}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Summary:</td> 
                                                                                                                <td>{{data.Summary}}</td> 
                                                                                                </tr> 
                                                                                </tbody> 
                                                                </table> 
                                                </div>`, 
                                data() { 
                                  return { 
                                                data: {} 
                                                }; 
                                  } 
  }) }; 

And for further reference, kindly refer the below Vue documentation, 

And for that, we have taken the screenshot of the above rendered sample, 
 


Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Hareesh 



UN Unknown Syncfusion Team September 14, 2020 05:22 AM UTC

Hi,

When implement sample code in my project, I am getting same result. But sample code run separately.
On each column counter value is coming exactly, but data not displayed. 

Regards,
Somsubhra





UN Unknown Syncfusion Team September 14, 2020 05:49 AM UTC

Please check attachment.

Attachment: sample1_5b9276de.zip


HB Hareesh Balasubramanian Syncfusion Team September 14, 2020 12:10 PM UTC

Hi Somsubhra, 

Thanks for the update. 

We have validated your shared image at our end. And for that, we suspect that you have not included the CSS property for the Kanban sample that could be the reason for the reported problem. And also kindly include our previously updated solution in the Card template function. We can able to replicate your issue in our previously updated sample as per your shared image, kindly refer the below differentiated table for further reference,  

Code snippet: 
Code snippets 
Issue replicating image 
Shared sample image 
<head> 
  <meta charset="utf-8"> 
  <title>EJ2 VueJS Kanban</title> 
  <link rel="shortcut icon" rel='nofollow' href="./src/assets/logo.png" /> 
  <link rel='nofollow' href="http://cdn.syncfusion.com/ej2/material.css" rel="stylesheet" type="text/css"/> 
</head> 


In CradTemplate
data() { 
    return { 
       data: {} 
      }; 
 
 

And the same sample can be downloaded from the following link, 

Kindly try the above solution and if the issue still persists at your end kindly share the below details to serve you better? 
 
  • Replicate the issue in the above sample
  • Share the issue replicating sample (if possible)
 
 
Regards, 
Hareesh 



UN Unknown Syncfusion Team September 15, 2020 10:02 AM UTC

Hi Hareesh,

Thanks for your support. But I have tried to implement the above code and the problem I am facing is with 'cardSettings' props whenever i am removing the props I am being able to see the cards inside the kanban view but those are empty without any title or description inside it and if I use the 'cardSettings' props and pass a value to it I am not being able to see any cards.

My cardSettings structure is like this (Html tags are as it is you mentioned on your sample) - 

cardSettings: {
//contentField: "Summary",
headerField: "Id",
template: function() {
return {
template: Vue.component('cardTemplate', {
template: `
Id:{{data.Id}}
Type:{{data.Type}}
Priority:{{data.Priority}}
Summary:{{data.Summary}}
`
,
data() {
return {
data: {}
};
}
})
};
}
},

Also, I am using this material css path, import "@syncfusion/ej2-vue-kanban/styles/material.css";. 

Regards,
Somsubhra

Attachment: sample1_60c050bd.zip


HB Hareesh Balasubramanian Syncfusion Team September 16, 2020 01:26 PM UTC

Hi Somsubhra, 

Thanks for the update. 

We have validated your shared code snippets at our end. And we suspect that the rendering structure of the cradTemplate property of the Kanban component could be the reason for the reported problem. And for that, kindly refer the below snippets of the cardTemplate for the Kanban component. And the same can be downloaded from the above sample. 

Code snippet
cardSettings: { 
headerField: "Id", 
template: function() { 
  return { template: Vue.component('cardTemplate', { 
                template: `<div class='e-card-content'> 
                                                                <table class="card-template-wrap"> 
                                                                                <tbody> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Id:</td> 
                                                                                                                <td>{{data.Id}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Type:</td> 
                                                                                                                <td>{{data.Type}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Priority:</td> 
                                                                                                                <td>{{data.Priority}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Summary:</td> 
                                                                                                                <td>{{data.Summary}}</td> 
                                                                                                </tr> 
                                                                                </tbody> 
                                                                </table> 
                                                </div>`, 
                                data() { 
                                  return { 
                                                data: {} 
                                                }; 
                                  } 
  }) }; 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Hareesh 



AM Alex Mahterian March 17, 2021 07:51 PM UTC

I'm having the same problem as the others. No combination of the above code results in displaying the template as written. I'm using the code from the attachment provided by one of the SyncFusion admins / developers.


HB Hareesh Balasubramanian Syncfusion Team March 18, 2021 01:53 PM UTC

Hi Alex, 

Thanks for the update. 

We have prepared a sample to reproduce your reported issue “contents are not rendering inside the Kanban template ” unfortunately, we were unable to reproduce your reported problem and the sample can be downloaded from the following link. We have tried the following ways to replicate the issue at our end. 

  1. We have ensured the Kanban cards are properly rendering with and without cardTemplate.
  2. Also we have ensured the below sample in different browser like Chrome, Edge, Firefox and it is rendering properly in it.


template: function() { 
  return { template: Vue.component('cardTemplate', { 
                template: `<div class='e-card-content'> 
                                                                <table class="card-template-wrap"> 
                                                                                <tbody> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Id:</td> 
                                                                                                                <td>{{data.Id}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Type:</td> 
                                                                                                                <td>{{data.Type}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Priority:</td> 
                                                                                                                <td>{{data.Priority}}</td> 
                                                                                                </tr> 
                                                                                                <tr> 
                                                                                                                <td class="CardHeader">Summary:</td> 
                                                                                                                <td>{{data.Summary}}</td> 
                                                                                                </tr> 
                                                                                </tbody> 
                                                                </table> 
                                                </div>`, 
                                data() { 
                                  return { 
                                                data: {} 
                                                }; 
                                  } 
  }) }; 

Note: Kindly follow the same structure to render the card template of the Kanban component. 

And for the same, we have taken a screenshot of the above sample, 
 
 
Kindly refer to the above sample, also share the below details to validate your reported issue and serve you better. 
  • Kindly confirm whether our updated sample is working properly or not at your side?
  • Kindly confirm whether the issue is related to the cardTemplate or some other issues ?
  • If possible, replicate the issue in the above sample.
  • Share the issue replicating sample (if possible) in order to validate further at our end.

We will be happy to assist you..! 

Regards, 
Hareesh 



HO Holger March 19, 2021 08:13 AM UTC

Dear Hareesh,

Thank you for your continued support. Highly appreciated. I am not sure, if I can add something here, but would share my experience.

I have tested your sample fom https://www.syncfusion.com/downloads/support/forum/157537/ze/sample-847843161 

as a stand alone app with npm install/ npm run dev and it runs smoothly under localhost:5000. It does show cards and contents.

But, when I copy the App.vue file from your sample into my project to test the template feature on cards, however, it does not show the cards or the  content. It does show the number of cards per column (see attached image).

I have tested other examples from the docs with success, no issues.

E.g. The header example (without the template feature) from the docs (https://ej2.syncfusion.com/vue/documentation/kanban/cards/#header)  works in my project. I.e. it does show the cards and the content from the "Summary" fields in the cards.

But replacing the line
 contentField: "Summary",

with a dummy template

 template: function () {
          return {
            template: Vue.component("cardTemplate", {
              template: `<div >
                       TEST
                    </div>`,
              data: function () {
                return {};
              },
            }),
          };
        },
again, it does not show any content or cards.

There are no error messages while compiling or in the firefox or chrome console.

My Vue version is 2.9.6, vue-loader  ^15.9.5, css styles are loaded.

I have no conclusion yet, since I cannot figure out the root cause. Perhaps it has to do with Vue versions or installation.

Any ideas appreciated.

Holger





Attachment: kanban_4d596a2f.zip


AM Alex Mahterian March 19, 2021 07:16 PM UTC

I'm having an identical issue. I can get the standalone app to run a display the template in your example app, but when I copy the exact code over to my production app, it doesn't render the templates, but it does show the number of items in the header. This is currently unresolved.


HB Hareesh Balasubramanian Syncfusion Team March 22, 2021 12:43 PM UTC

Hi Holger/Alex, 

Thanks for the update. 

We have validated your shared snippets at our end and let you know that latest stable version for VueJS 2 as “2.6.12”. We suspect that you have used improper vue version and for your reference we have prepared the same sample using code sandbox in that we can select the Vue version also, which can be viewed from the following link. 


And for further reference kindly refer to the below link, 

Kindly try the above solution and share issue replicating sample or try to replicate the problem in our shared sample. 

We will happy to assist you..! 

Regards, 
Hareesh 



AM Alex Mahterian March 22, 2021 04:27 PM UTC

Hello. Changing the version of Vue to 2.6.12 from 2.6.10 did not fix the issue. 


NR Nevitha Ravi Syncfusion Team March 23, 2021 07:13 AM UTC

Hi Alex, 

Thanks for your update. 

Since we are not able to replicate the issue, could you please share any of the following details to validate the issue at our end? 
  • Issue replicating code or sample
  • Try to replicate the issue in a sample
  • Do you face the issue in specific browser or device?

Regards, 
Nevitha  



AM Alex Mahterian March 23, 2021 03:20 PM UTC

I can get the standalone app to run properly and display the template in your example app, but when I copy the exact same code over to my production app, it doesn't render the templates, but it does show the number of items in the header. I'm using the same version of vue as the sample code, and the same version of the other npm libraries as the sample app. I'm using the latest version of Chrome.


RV Ravikumar Venkatesan Syncfusion Team March 24, 2021 04:04 PM UTC

Hi Alex, 

Thanks for the update. 

We have validated your reported problem “Kanban card template not rendered” at our end and suspect that the cardTemplate maybe not property added to the Kanban. We have prepared a sample with cardTemplate and checked in both development and the production mode which works as expected. You can download the sample from the below link. 


Steps to run in production: 
Run the following commands in the command window from the project root folder 
  1. npm install
  2. npm run serve
  3. npm run build
  4. serve -s dist

Kindly try the above sample and if you still facing the same problem share the below details to serve you better. 

  • Share the version of the “@syncfusion/ej2-vue-kanban” package you are using or
  • Reproduce the problem in the above-shared sample which would help us to proceed further.

Regards, 
Ravikuamar Venkatesan 



AM Alex Mahterian March 29, 2021 07:21 PM UTC

I downloaded the above package and followed the instructions. Again, I can run your sample code provided in the link and it renders the templates correctly, but when I copy everything over to my app exactly as it is, it stops rendering. I'm using the same kanban plugin version, the same vue version, the same corejs version, and the same vue template compiler as your sample code. 




AM Alex Mahterian March 29, 2021 08:49 PM UTC

* I'm also using the same vue cli plugins and the same babel preset


AM Alex Mahterian March 30, 2021 07:59 PM UTC

'onCardRender' is not being triggered when I copy over the source code you provided. It is being triggered in the sample app, but not when I copy it over to my app.


AM Alex Mahterian March 30, 2021 08:25 PM UTC

Alright so, I managed to get blank cards to render under the headers, but I still can't get content to show. I looked at the docs, and the cardSettings template field is expected to be a string.

https://ej2.syncfusion.com/vue/documentation/api/kanban/cardSettingsModel/#template

I changed it to

cardSettings: {
headerField: "Id",
template: `<template><div style="color: black">Test</div></template>`,
}


and that renders a list of blank cards with no content.

Also why can't I upload a local image anymore to these RTEs?









AM Alex Mahterian March 30, 2021 08:47 PM UTC

I upgraded to 19.1.54 via the NPM page and the problem is still occurring. 


RK Revanth Krishnan Syncfusion Team March 31, 2021 06:07 AM UTC

Hi Alex, 
 
We have created a new incident under your Direct-Trac account to follow up with this query. We suggest you to follow up with the incident for further updates. Please log in using the below link.  
 
 
Regards, 
Revanth 



AM Alex Mahterian April 2, 2021 02:53 PM UTC

For the other people in this thread, I was able to make the following code work to render the cards.



cardSettings: {
headerField: "Id",
template: function() {
return {
template: Vue.component('cardTemplate', {
template: `<div class='e-card-content'>
<table class="card-template-wrap">
<tbody>
<tr class="content-row">
<td class="CardHeader">Id:</td>
<td>{{$data.data.Id}}</td>
</tr>
<tr class="content-row">
<td class="CardHeader">Type:</td>
<td>{{$data.data.Type}}</td>
</tr>
<tr class="content-row">
<td class="CardHeader">Priority:</td>
<td>{{$data.data.Priority}}</td>
</tr>
<tr class="content-row">
<td class="CardHeader">Summary:</td>
<td>{{$data.data.Summary}}</td>
</tr>
</tbody>
</table>
</div>`,
data() {

},
components: {

}
})
}
}
},


NR Nevitha Ravi Syncfusion Team April 5, 2021 06:52 AM UTC

Hi Alex, 

Thanks for your update. 

We are happy that your reported issue has been resolved at your end. Please get back to us if you need any further assistance. 

Regards, 
Nevitha. 



AM Alex Mahterian April 7, 2021 05:41 PM UTC

I am still experiencing issues. I am able to render field data as shown in my previous post, but I'm unable to render an imported chart in the card template. The following code renders a blank card. ( I know it's not the pie chart component, because I am able to render this same chart inside the Data Grid Row Templates. )

cardSettings: {
headerField: "Id",
template: function() {
return {
template : Vue.component('columnTemplate',{
components: {
PieChart
},
template: `<div class="pie-chart">
<pie-chart :chartData="chartData"></pie-chart>
</div>`,
data() {
return {
chartData: {
header: ''
}
}
}
})
}
}
},


AM Alex Mahterian April 7, 2021 06:11 PM UTC

I think figured out the problem. Something within the card template logic negates any global scope access from a nested imported component. In the PieChart, I have multiple references to this.$store and this.$amcore ( AMCharts is installed in main.js ) and the new scope created by the CardTemplate made those values null. This doesn't occur in the ColumnTemplate logic for DataGrid, so I think this is a problem specifically inside the CardTemplate logic. When I remove those global references, the chart renders.


RK Revanth Krishnan Syncfusion Team April 12, 2021 02:37 AM UTC

Hi Alex, 
 
 
We are currently validating your query, we will validate and let you know with further details on or before 14th April. 
We appreciate your patience till then. 
 
Regards, 
Revanth 



RK Revanth Krishnan Syncfusion Team April 14, 2021 02:31 PM UTC

Hi Alex, 
 
Thanks for your patience. 
 
We have validated your reported problem at our end. We have prepared a sample with pie chart inside the Kanban card template. You can check the code and a sample from the below. 
 
Code Snippet: 
App.vue 
import PieChart from "./PieChart.js"; 
export default { 
  name: "App", 
  components: {}, 
  data() { 
    return { 
      cardSettings: { 
        headerField: "Id", 
        template: function () { 
          return { 
            template: Vue.component("cardTemplate", { 
              template: `<div class='e-card-content'> 
               <pie-chart :data="chartData" :options="chartOptions"></pie-chart> 
                        <table class="card-template-wrap"> 
                            <tbody> 
                                <tr class="content-row"> 
                                    <td class="CardHeader">Id:</td> 
                                    <td>{{$data.data.Id}}</td> 
                                </tr> 
                            </tbody> 
                        </table> 
                    </div>`, 
              data() { 
                return { 
                  chartOptions: { 
                    hoverBorderWidth: 20, 
                  }, 
                  chartData: { 
                    hoverBackgroundColor: "red", 
                    hoverBorderWidth: 10, 
                    labels: ["Green", "Red", "Blue"], 
                    datasets: [ 
                      { 
                        label: "Data One", 
                        backgroundColor: ["#41B883", "#E46651", "#00D8FF"], 
                        data: [1, 10, 5], 
                      }, 
                    ], 
                  }, 
                }; 
              }, 
              components: { 
                PieChart, 
              }, 
            }), 
          }; 
        }, 
      }, 
    }; 
  }, 
}; 
</script> 
 
 
Please find the sample for your reference. 
 
 
Kindly try the above sample and if you still face the same problem, can you reproduce the issue in above shared sample and share which would help us to proceed further.  
 
Regards, 
Revanth 


Loader.
Up arrow icon