[ANGULAR] Split pane. Calendar on the left and Editor on the right
Posted: Tue Jan 03, 2023 3:56 pm
by ashik
Hello,
The default behaviour of the editor is a pop up. I want to have the calendar on the left and the editor on the right. The default view should be calendar occupying the entire width of the screen. Upon editing an event the editor should slide in from the left resizing the calendar to 70% of the screen.
I'm thinking of setting up a splitter but I'm not sure where to start in Angular,
const calendar = new Calendar({
// Start life looking at this date
date : new Date(2020, 9, 12),
// CrudManager arranges loading and syncing of data in JSON form from/to a web service
crudManager : {
transport : {
load : {
url : 'data/data.json'
}
},
autoLoad : true
},
appendTo : 'wrapper',
listeners : {
beforeEventEdit({ eventRecord }) {
panel.expand();
panel.widgetMap.nameField.value = eventRecord.name
return false;
}
},
// Features named by the properties are included.
// An object is used to configure the feature.
features : {
eventTooltip : {
// Configuration options are passed on to the tooltip instance
// We want the tooltip's left edge aligned to the right edge of the event if possible.
align : 'l-r'
}
}
});
const panel = window.panel = new Panel({
appendTo : 'wrapper',
width : 0,
title : 'Event Edit',
collapsible : true,
collapsed : true,
items : {
nameField : {
type : 'text',
label : 'name',
}
},
bbar : {
items : {
saveButton : {
type : 'button',
text : 'save',
onAction() {
calendar.selectedEvents[0].set('name', panel.widgetMap.nameField.value);
// collapse the panel
panel.collapse();
// set the fields to empty
panel.widgetMap.nameField.value = '';
}
}
}
}
});
And here is the output in the video attached.
Re: [ANGULAR] Split pane. Calendar on the left and Editor on the right
Posted: Wed Jan 04, 2023 9:36 am
by ashik
Exactly what I'm looking for. Do you have a sample for Angular?
Re: [ANGULAR] Split pane. Calendar on the left and Editor on the right
Posted: Wed Jan 04, 2023 12:19 pm
by ashik
I'm unable to use panel.expand() using ViewChild decorator. What is the angular way of doing it?
I tried property binding for
[collapsed]="true"
but changing the value to false does not change the behaviour. Only the initial value true/false is taken into account.
const calendar = new Calendar({
// Start life looking at this date
date : new Date(2020, 9, 12),
// CrudManager arranges loading and syncing of data in JSON form from/to a web service
crudManager : {
transport : {
load : {
url : 'data/data.json'
}
},
autoLoad : true
},
appendTo : 'wrapper',
listeners : {
beforeEventEdit({ eventRecord }) {
panel.expand();
panel.widgetMap.nameField.value = eventRecord.name
return false;
}
},
// Features named by the properties are included.
// An object is used to configure the feature.
features : {
eventTooltip : {
// Configuration options are passed on to the tooltip instance
// We want the tooltip's left edge aligned to the right edge of the event if possible.
align : 'l-r'
}
}
});
const panel = window.panel = new Panel({
appendTo : 'wrapper',
width : 0,
title : 'Event Edit',
collapsible : true,
collapsed : true,
items : {
nameField : {
type : 'text',
label : 'name',
}
},
bbar : {
items : {
saveButton : {
type : 'button',
text : 'save',
onAction() {
calendar.selectedEvents[0].set('name', panel.widgetMap.nameField.value);
// collapse the panel
panel.collapse();
// set the fields to empty
panel.widgetMap.nameField.value = '';
}
}
}
}
});
And here is the output in the video attached.
Re: [ANGULAR] Split pane. Calendar on the left and Editor on the right
Posted: Wed Jan 04, 2023 12:28 pm
by tasnim
I've created an Angular demo for you
Here is the output of angular demo
chrome_FiDMzmLgOO.gif (780.41 KiB) Viewed 650 times
Please check the attached zip
Re: [ANGULAR] Split pane. Calendar on the left and Editor on the right
Posted: Wed Jan 04, 2023 12:54 pm
by Animal
Probably best not to throw the event editor out. It does a lot.