Hello,
I am working on syncfusion scheduler react components and in that I added my location field with drop down location as we required drop down for that on other side where by default components also have default it's location filed with textbox and I want to remove that from edit popup. I tried to find solution on all sample code and forum but didn't get luck to find out it out that.
I am using React Typescript with Hooks. Can you please provide any sample that how I can achieve that ?
Sample code for components
Sample code for customization of location with drop down
is there any update for me ?
You can hide the default location field using the shared CSS class and insert a new location field like the below code.
Sample: https://stackblitz.com/edit/react-wdhhpl?file=index.js,index.css
[index.js]
if (!args.element.querySelector('.custom-field-row')) {
let row = createElement('div', { className: 'custom-field-row' });
let formElement = args.element.querySelector('.e-schedule-form');
formElement.firstChild.insertBefore(row, formElement.firstChild.children[1]);
let container = createElement('div', { className: 'custom-field-container' });
let inputEle = createElement('input', {
className: 'e-field', attrs: { name: 'Location' } });
container.appendChild(inputEle);
row.appendChild(container);
let dropDownList = new DropDownList({
dataSource: [
{ text: 'Room 1', value: 'Room 1' },
{ text: 'Room 2', value: 'Room 2' },
],
fields: { text: 'text', value: 'value' },
value: args.data.Location,
floatLabelType: 'Always',
placeholder: 'Location'
});
dropDownList.appendTo(inputEle);
inputEle.setAttribute('name', 'Location');
}
[index.css]
.e-schedule-dialog .e-location-container{
display: none;
}
Output:
Thank you it's working.