How to access resource data in quickInfo dialog when adding new event?

When I click an empty cell to add a new event, the only values captured are StartTime, EndTime, IsAllDay and elementType. I need to capture the ID or name of the staff member (resource) in the column where the appointment is being created. How can I access this data?


When i click on the task templete which is not an empty cell, userId is getting captured.But we want userId in empty cell popup also.So we can assign appointment  to the respectiive staff member (resource). Even if i use ref, userId is not even getting captured.

Please fine attached files .

Attachment: Scheduler_userId__not_captured_d2b2c878.zip

1 Reply

VM Vengatesh Maniraj Syncfusion Team May 7, 2020 05:40 AM UTC

Hi Sudhanshu, 

Greetings from Syncfusion Support. 

We have validated your query that “how to get resource data when clicking on empty cell” at our end and we let you know that the scheduler does not pass the resource data while clicking on the empty cell. So we suggest you please use the popupOpen and popupClose events to get the resource details from the target element like the  below code. 

onPopupOpen(props) { 
    if ( 
      props.type === "QuickInfo" && 
      props.target.classList.contains("e-work-cells") 
    ) { 
      var currentResourceIndex = parseInt( 
        props.target.getAttribute("data-group-index") 
      ); 
      var drowDownList = new DropDownList({ 
        dataSource: this.categoryData, 
        fields: { text: "text", value: "id" }, 
        placeholder: "Resource Name", 
        index: currentResourceIndex 
      });       
      drowDownList.appendTo(props.element.querySelector(".resourceName")); 
    } 
  } 
  onPopupClose(args) { 
    var selectedIndex = args.element.querySelector('.resourceName').ej2_instances[0].value; 
    var resourceId = this.categoryData[selectedIndex - 1].id; 
    args.data.ResourceId = resourceId; 
  } 

For the same, we have prepared the sample which is available in the below link. 


Please check the above sample and get back to us for further assistance. 

Regards, 
Vengatesh 


Loader.
Up arrow icon