Hi,
So confused...what I am working on now is to rewrite the "New Appointment" window, set "subject" line as a textbox which can be input manually, set location line as a dropdownlist, its values are read from a string list. But I had an error bothered me long time...
"0x800a138f - JavaScript runtime error: Unable to get property 'id' of undefined or null reference"
I am pretty sure the error is from the "subject" textbox line whereas if I hide "location" line and set "subject" as a dropdownlist instead, it works. If I hide location line, only have a default "subject" as textbox, it has same error info as above.
That means, the dropdownlist works on "subject", doesn't work on "location"...
My code is below:
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;
}
// Cache the original drawContent function
var drawContentOriginal = MindFusion.Scheduling.EditForm.prototype.drawContent;
// EditForm.drawContent override
MindFusion.Scheduling.EditForm.prototype.drawContent = function () {
// Draw the form's content
drawContentOriginal.apply(this, arguments);
var eventType = this.createDropDownList({
id: 'location',
items: populateEventTypeItems(),
initValue: this.item.location,
addEmptyValue: false
});
eventType.element.style.width = "355px"
var locationOriginal = this.getControls()['location'];
locationOriginal.element.parentNode.appendChild(eventType.element);
locationOriginal.element.parentNode.removeChild(locationOriginal.element);
this.getControls()['location'] = eventType;
// Hide the reminder row
this._content.find('div.reminder-row')[0].style.display = 'none';
this._content.find('div.hr-line')[1].style.display = 'none';
// Hide the contacts list
this._content.find('table')[1].rows[0].cells[1].style.display = 'none';
// Adjust the details area size
this.getControls()['details'].element.style.width = "430px";
};
Can anyone give any hint? Big thx