We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Passing param to template


import WorkScheduleEdit from './WorkScheduleEdit.vue'


editorTemplate: function(e) {
         return {
                 template: WorkScheduleEdit,
         };
   },
          

All works, but!

I have data  object - 

1. I need to pass data or values into my TEMPLATE but dont know how I can do it

10 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team April 16, 2019 06:01 AM UTC

Hi Marco 
  
Greetings from Syncfusion. 
 
We have logged the below bug report to access the field values of an event or cell within the editor template design. The fix will be included in JS2 weekly release on April 23, 2019.  
 
Regards,  
Karthi  
 



GP Georgi Panayotov April 22, 2019 11:11 PM UTC

We had same problem. The solution we found was to extend the template:

editorTemplate: function(e) {
         let self = this;        
         return {
                 template: {
                      extends: WorkScheduleEdit,,
                      propsData: {
                            dataValue: self.valueToTemplate
                      }
         };
   },


MA Marco April 23, 2019 05:37 AM UTC

Man, thank you :DDD


NR Nevitha Ravi Syncfusion Team April 23, 2019 01:52 PM UTC

Hi Marco, 
  
We are happy that your issue has been resolved. Please let us know if you need to any further assistance. 
  
Regards,
Nevitha 



MA Marco April 23, 2019 06:16 PM UTC

I need assistance, how pass computed data to template? :((((


NR Nevitha Ravi Syncfusion Team April 24, 2019 11:27 AM UTC

Hi Marco, 

Thanks for your update. 

Now we can access the field values of cell/event within editor template which has been included in our latest package 17.1.42. And we have prepared sample for your reference to access the data which can be downloaded from the following link. 

<template> 
  <table class="custom-event-editor" width="100%" cellpadding="5"> 
    <tbody> 
      <tr id="summaryRow"> 
        <td class="e-textlabel">Summary</td> 
        <td colspan="4"> 
          <input 
            id="Subject" 
            class="e-field e-input" 
            type="text" 
            :value="data.Subject" 
            name="Subject" 
            style="width: 100%" 
          > 
        </td> 
      </tr> 
      <tr id="eventTypeRow"> 
        <td class="e-textlabel">Status</td> 
        <td colspan="4"> 
          <ejs-dropdownlist 
            id="EventType" 
            name="EventType" 
            class="e-field" 
            :value="data.Status" 
            placeholder="Choose status" 
            :dataSource="eventType" 
          ></ejs-dropdownlist> 
        </td> 
      </tr> 
      <tr id="fromRow"> 
        <td class="e-textlabel">From</td> 
        <td colspan="4"> 
          <ejs-datetimepicker 
            id="StartTime" 
            class="e-field" 
            :value="dateParser(data.startTime || data.StartTime)" 
            name="StartTime" 
          ></ejs-datetimepicker> 
        </td> 
      </tr> 
      <tr id="toRow"> 
        <td class="e-textlabel">To</td> 
        <td colspan="4"> 
          <ejs-datetimepicker 
            id="EndTime" 
            class="e-field" 
            :value="dateParser(data.endTime || data.EndTime)" 
            name="EndTime" 
          ></ejs-datetimepicker> 
        </td> 
      </tr> 
      <tr id="reasonRow"> 
        <td class="e-textlabel">Reason</td> 
        <td colspan="4"> 
          <textarea 
            id="Description" 
            class="e-field e-input" 
            :value="data.Description" 
            name="Description" 
            rows="3" 
            cols="50" 
            style="width: 100%; height: 60px !important; resize: vertical" 
          ></textarea> 
        </td> 
      </tr> 
    </tbody> 
  </table> 
</template> 
 
<script> 
import Vue from "vue"; 
import { DateTimePickerPlugin } from "@syncfusion/ej2-vue-calendars"; 
import { DropDownListPlugin } from "@syncfusion/ej2-vue-dropdowns"; 
Vue.use(DropDownListPlugin); 
Vue.use(DateTimePickerPlugin); 
 
export default { 
  name: "EventTemplate", 
  data() { 
    return { 
      eventType: ["New", "Confirmed", "Rejected"], 
      data: {} 
    }; 
  }, 
  methods: { 
    dateParser: function(data) { 
      return new Date(data); 
    } 
  } 
}; 
</script> 

Regards, 
Nevitha. 




DA Dave October 20, 2020 11:48 AM UTC

Where did you find the solution or the properties that we can pass in the template?
The documentation says nothing about it:


NR Nevitha Ravi Syncfusion Team October 21, 2020 03:43 PM UTC

Hi Dave, 
  
Greetings from Syncfusion support. 
  
By default we can access all the appointment fields in scheduler datasource, please find the refer the following UG link. 
  
Regards, 
Nevitha 



IF Isabelle Fuchs November 17, 2020 10:55 AM UTC

i would need neraly the same - just for the Tooltip Template - can you help me how i could bring the datat fom the event - to the Tooltip Template

thanks

Isabelle


NR Nevitha Ravi Syncfusion Team November 18, 2020 06:03 AM UTC

Hi Isabelle, 

Greetings from Syncfusion Support. 

Please refer the following online demo to show data from events in tooltip template and get back to us if you need any assistance. 

Regards, 
Nevitha 


Loader.
Live Chat Icon For mobile
Up arrow icon