Events List

Hi,

Q1. I have a list view of all events in a div to the right of my dhtmlxScheduler. I populate the list in JavaScript, looping through my data in a JavaScript array.

Is there a way to do this quicker, as the list does take some time to draw:

[code]function addToList(id,bsubject){
var ni = document.getElementById(‘eventlisting’);

var newdiv = document.createElement('div');
newdiv.setAttribute('id',id);

newdiv.innerHTML = '<hr><div>'+bsubject+'</div>';
ni.appendChild(newdiv);

}[/code]

Is it the appendChild JS function that is more time consuming?

Q2. Could I add the Ajenda view next to the scheduler? For example, have the graphical scheduler on the left 90% of the window and the ajenda view on the right 10% of the window (but a different data/event set in the ajenda view).

Many thanks.

Q1
In case of big amount of the data, it will be faster to store an html string for all events and do the single innerHTML at the end

Q2
It is not possible.
Agenda uses similar looping and rendering technique, so there will be no any significant benefits.

Thank you for the reply. I cannot use a single string as I assign properties to the div (such as ID and other attributes that I use later). Is there a way I can create the div but add it to HTML after dynamic loading?

Many Thanks.

I cannot use a single string as I assign properties

[code] var newdiv = document.createElement(‘div’);
newdiv.setAttribute(‘id’,id);

newdiv.innerHTML = '<hr><div>'+bsubject+'</div>';[/code]

is equal to

var html  ="<div id='"+id+"'><hr><div>"+bsubject+"</div></div>";

Doh! Of course, thank you Stansilav. I always think there is going to be a difficult resolution, when the solution could be extremely simple.

Thanks again, have a great day!