Hi Lyubo, one more question in Javascript.
Say I create new appointment, right now in the "New Appointment" window I have subject as a textbox, location as a dropdownlist, then start time and end time of course. Values in the dropdownlist are from database, here I achieved that.
My code is here
var a = JSON.parse('<% = this.javaSerial.Serialize(this.eventValue) %>');
var populateEventTypeItems = function ()
{
var result = [];
for (var i = 0; i < a.length; i++) {
result.push({value: a[i], text: a[i]});
}
return result;
}
var eventType = this.createDropDownList({
id: 'EventsType',
items: populateEventTypeItems(),
initValue: this.item.subject,
addEmptyValue: false
});
eventType.element.style.width = "355px"
var locationOriginal = this.getControls()['location'];
locationOriginal.element.parentNode.appendChild(eventType.element);
//locationOriginal.element.remove();
locationOriginal.element.parentNode.removeChild(locationOriginal.element);
// Replace also the control in the forms controls collection
this.getControls()['location'] = eventType;
It seems work, but to obtain the textbox value of subject, I got error saying sth like "id is null blablabla"
My code of subject textbox is below
var subjectText = document.getElementById('subject');
document.getElementById('subject').appendChild(subjectText);
var subjectOriginal = this.getControls()['subject'];
subjectOriginal.element.parentNode.appendChild(subjectText.element);
subjectOriginal.element.parentNode.removeChild(subjectOriginal.element);
this.getControls()['subject'] = subjectText;
How to correct my code to display new created appointment properly?
Lyubo wrote on Mar 21
st, 2014 at 12:58pm:
Hi,
Check out this sample application:
https://mindfusion.eu/_samples/WebPlanner.Database.zip.
It demonstrates one way to synchronize the planner's schedule with an underlying database.
The application uses SQL Compact Edition 4.0 as datastore, but the principle will remain the same with Oracle, too.
The database is updated as a response to an ItemCreated, ItemModified, ItemInplaceEdited or ItemDeleted event. The appointments and contacts are matched in the database by the auto-id, which is cached in the Appointment.Tag property.
Regards,
Lyubo