- Home
- Forum
- React - EJ 2
- How to access resource data in quickInfo dialog when adding new event?
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?
SIGN IN To post a reply.
3 Replies
VM
Vengatesh Maniraj
Syncfusion Team
January 8, 2020 10:31 AM UTC
Hi Edward,
Greetings from Syncfusion Support.
Based on the requirement, we have prepared below sample which displayed the resource details in quickInfoTemplate.
Kindly try the above and revert us for further assistance with this.
Regards,
Vengatesh
SJ
Sudhanshu Jain
May 6, 2020 10:36 AM UTC
Hi Syncfusion,
This above solution does not work. Still if we click on empty cell , resource id Or name is not coming in the data.How we can access empty cell data?
VM
Vengatesh Maniraj
Syncfusion Team
May 7, 2020 05:31 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
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
EB Edward Butler
- Jan 7, 2020 04:02 PM UTC
- May 7, 2020 05:31 AM UTC