- Home
- Forum
- React - EJ 2
- Customize the small editor
Customize the small editor
I wanted to customise the editor not the detailed one which we can using editor template but the small one before popup
i want to add just one more field to it which is a dropdown
and want to display that in the scheduler and not the title
so how to firstly customize the editor and secondly display not the title/subject but that added field dropdown value plus time on the scheduler as event
and lastly i believe it automatically updates the events array after an event is rendered
so i have made a state and use that initial events as my initial value and use that state variable as dataSource
Hi Aby,
You can use quickInfoTemplates to achieve your requirement.
https://ej2.syncfusion.com/react/demos/#/material3/schedule/quick-info-template
https://ej2.syncfusion.com/react/documentation/schedule/editor-template#customizing-quick-popups
Regards,
Satheesh Kumar B
Thanks and how do i show my dropdown value in the schedular instead of subject when submitting quickinfo template. By dfault it displays the title value in cell but i want to show my dropdown value in it instead of subject/title
Hi Aby,
Sample: https://stackblitz.com/edit/react-anw52p-vjy8aa?file=index.js
You can achieve your requirement by setting up the eventTypeObj(dropdown)
text value to the Subject value, as shown in the highlighted code
snippet below. Try the shared sample and let us know if you need any further
assistance.
[index.js]
|
const buttonClickActions = (e) => { const quickPopup = closest(e.target, '.e-quick-popup-wrapper'); const getSlotData = () => { const addObj = {}; addObj.Id = scheduleObj.current.getEventMaxID(); addObj.Subject = eventTypeObj.current.text; addObj.StartTime = new Date(scheduleObj.current.activeCellsData.startTime); addObj.EndTime = new Date(scheduleObj.current.activeCellsData.endTime); addObj.IsAllDay = scheduleObj.current.activeCellsData.isAllDay; addObj.Description = isNullOrUndefined(notesObj.current.value) ? 'Add notes' : notesObj.current.value; addObj.RoomId = eventTypeObj.current.value; return addObj; };
return (<div className="quick-info-content"> {props.elementType === 'cell' ? <div className="e-cell-content"> <div className="content-area"> <TextBoxComponent id="title" ref={titleObj} placeholder="Title"/> </div> <div className="content-area"> <DropDownListComponent id="eventType" ref={eventTypeObj} dataSource={roomData} fields={{ text: "Name", value: "Id" }} placeholder="Choose Type" index={0} popupHeight="200px"/> </div> <div className="content-area"> <TextBoxComponent id="notes" ref={notesObj} placeholder="Notes"/> </div> </div> : <div className="event-content"> <div className="meeting-type-wrap"> <label>Subject</label>: <span>{props.Subject}</span> </div> <div className="meeting-subject-wrap"> <label>Type</label>: <span>{getEventType(props)}</span> </div> <div className="notes-wrap"> <label>Notes</label>: <span>{props.Description}</span> </div> </div>} </div>); };
|
Regards,
Venkatesh
Thankyou.Iam doing it but i thought its not proper way to assign the classname of subject to my depatment.
i have one more query. I know what the issue is but i can't seem to get hold of the solution. so basically there are two Scheduler Components. One is user and one is dept. So i am basically sending the user events which contain department dropdown value into dept one and basically informing the dept that this user is assigned for this dept at this slot etc and i am using useContext hook and basically updating the deptEvents through useState after i get userEvent
So the issue is that when i am using setState method for updating my deptEvents since it is synchoronous it is executed at the end after every thing is done and my deptEvent doesn't show the userEvent data.However if i rerender then it does show me the data on second render since uptil now useState has been executed and data has been set. I wanna show data on first render whenever the component is first rendered.
I am using useeffect but to no avail. It is giving me userEvent data but i cannot set it on time
Here is my deptSchedular Component. UserSchedular is similar one and i am not inserting here since it isn't needed. it is just updating its own userEvents and i am getting those events through useContext in Dept Schedular Component
. Also owner data is resourceData of Userevent with name of the user in it
and addnewSchedule is the method which updates the deptEvents after getting UserEvent in useEffect.Also why is previous event data rerendered every single time when any event is rendered.And not for once
Aby,
Q1. Thankyou.Iam doing it but i thought its
not proper way to assign the classname of subject to my department.
Since we are not able to get your point, could you please share more details like video or image about your exact requirement that help us to validate further and provide the solution ASAP?
Q2. i have one more query. I
know what the issue is but i can't seem to get hold of the solution. so basically
there are two Scheduler Components. One is user and one is dept. So i am
basically sending the user events which contain department dropdown value into
dept one and basically informing the dept that this user is assigned for this
dept at this slot etc and i am using useContext hook and basically updating the
deptEvents through useState after i get userEvent. So the issue is that when i
am using setState method for updating my deptEvents since it is synchoronous it
is executed at the end after every thing is done and my deptEvent doesn't show
the userEvent data.However if i rerender then it does show me the data on
second render since uptil now useState has been executed and data has been set.
I wanna show data on first render whenever the component is first rendered. I
am using useeffect but to no avail. It is giving me userEvent data but i cannot
set it on time Here is my deptSchedular Component. UserSchedular is similar one
and i am not inserting here since it isn't needed. it is just updating its own
userEvents and i am getting those events through useContext in Dept Schedular
Component.
We are unable to fully comprehend your requirement regarding sending events from one scheduler to another scheduler. To assist you better, could you please share an issue replicating the sample? This will enable us to understand the problem and provide you with an appropriate solution.
Q3. Regarding the issue of previous event data being re-rendered every time an event is rendered
We suspect that it could be related to the customizations you have made in the dataBound and eventRendered events. We would suggest reviewing your code in those event handlers to ensure that the updates are being applied correctly. If the issue persists, please provide a simplified sample or a video demonstration showcasing the problem. This would greatly help us understand and resolve the issue.
Regards,
Venkatesh
- 5 Replies
- 3 Participants
-
AY Ab Y
- Jul 11, 2023 09:51 PM UTC
- Jul 15, 2023 04:15 PM UTC