display static page to the public user

i want to display static page to the public user ,when he double click’s also he can’t edit , or save the events .and the whole events should be read only events. how to do that one.
can you explain full detail .And how can we keep the event Read only

You can simply add the following:

1- the link to the “dhtmlxscheduler_readonly.js” file and the link to its corresponding CSS file after the html head tag:

[code]

[/code]

2- the following code when the scheduler is initialized, in the init() js function (also in the same page):

scheduler.config.readonly = true;

Happy Coding

Display Static Calendar to the public User and if any events are there in a date. If User double click s the event it display’s the event with out Saving OR Delete Button like (dhtmlxScheduler\samples\03_extensions). But the remaining Empty Event Dates Should be opend to edit the event By the Public User.
i used this scripts in header …

and i used this one in int() scheduler.config.readonly = true;

But the remaining Empty Event Dates Should be opend to edit the event
It is not clear what do you mean by "Empty Event Dates "

Display Static Calendar to the public User and if any events are there in a date. If User double click s the event it display’s the event with out Saving OR Delete Button like (dhtmlxScheduler\samples\03_extensions). But the remaining Empty Event Dates Should be opend to edit the event By the Public User.

Sorry miss typed that one .
But the remaining Empty Event Dates which the ADIMN left empty(no event on that day) that Should not be opend to edit the event By the Public User.
i am clearly saying that the public user can see the event when he double clicks the event he see that event in light box

Now i got the idea …
This can be done as follows:

1- When the event is saved a readonly tag must be added to the event in the XML file.
When saving the events in an XML file (i custom coded a vb.net XML file writer) be sure to add this tag before the end of the events details, example:

[code]…


<start_date></start_date>
<end_date></end_date>

true ...[/code]

2- Add the link to the “dhtmlxscheduler_readonly.js” file and the link to its corresponding CSS file after the html head tag (i think you’ve already added them) and be sure to edit the path to the files with what suits your project:

[code]

[/code]

3- Replace the code ,i gave you before, when the scheduler is initialized, in the init() js function, that is:

scheduler.config.readonly = true;

By the following:

//block all modifications scheduler.attachEvent("onBeforeDrag", function () { return false; }) scheduler.attachEvent("onClick", function () { return false; }) scheduler.config.details_on_dblclick = true; scheduler.config.dblclick_create = false;

Happy Coding

Now i got the idea …
This can be done as follows:

1- When the event is saved a readonly tag must be added to the event in the XML file.
When saving the events in an XML file (i custom coded a vb.net XML file writer) be sure to add this tag before the end of the events details, example:

[code]…


<start_date></start_date>
<end_date></end_date>

true ...[/code]

2- Add the link to the “dhtmlxscheduler_readonly.js” file and the link to its corresponding CSS file after the html head tag (i think you’ve already added them) and be sure to edit the path to the files with what suits your project:

[code]

[/code]

3- Replace the code ,i gave you before, when the scheduler is initialized, in the init() js function, that is:

scheduler.config.readonly = true;

By the following:

//block all modifications scheduler.attachEvent("onBeforeDrag", function () { return false; }) scheduler.attachEvent("onClick", function () { return false; }) scheduler.config.details_on_dblclick = true; scheduler.config.dblclick_create = false;

Happy Coding

Hi Romeo , i followed your instructions and i get the output that is full static page (you can’t see the event on light box when double click that one . its just displaying the events .)

in xml i got like this


true
<start_date>2010-08-04 00:00:00</start_date>
<end_date>2010-08-04 00:05:00</end_date>
sdfsdf
sdfsd

sdfsd

and i added this line
scheduler.config.readonly = true;

and i blocked the remaining line ,

scheduler.attachEvent(“onBeforeDrag”, function () { return false; })
scheduler.attachEvent(“onClick”, function () { return false; })
scheduler.config.details_on_dblclick = true;
scheduler.config.dblclick_create = false;

and also try ed with out blocked the above lines

Thanking you.

You have to remove the

to achieve the desired effect.

I’ve tried it and it’s 110% perfectly working

Happy Coding

Sorry … forgot to put the code in the above post :laughing:

You have to remove the

scheduler.config.readonly = true;

to achieve the desired effect.

But keep the following codes:

scheduler.attachEvent("onBeforeDrag", function () { return false; }) scheduler.attachEvent("onClick", function () { return false; }) scheduler.config.details_on_dblclick = true; scheduler.config.dblclick_create = false;

I’ve tried it and it’s 110% perfectly working

Happy Coding

Try it again please …

Waiting your reply … :arrow_right:

Happy Coding

Hey Romeo , i try ed , but the event is not displaying on light box .

Thanking you …

i added the code like this

[code]function calendarInit() {

scheduler.config.xml_date = "%Y-%m-%d %H:%i";
scheduler.config.details_on_create = true;
scheduler.config.details_on_dblclick = true;
scheduler.config.prevent_cache=true;
scheduler.init('scheduler_here', new Date(), "month");
scheduler.load(jQuery.url.getChatURL("/calendar/eventsXml.do"));
//scheduler.toPDF(jQuery.url.getChatURL("/calendar/eventsXml.do"),'gray');
scheduler.attachEvent("onBeforeDrag", function () { return false; })
scheduler.attachEvent("onClick", function () { return false; })
scheduler.config.details_on_dblclick = true;
scheduler.config.dblclick_create = false;
 }[/code]

see the screen short


One moment please …

I’ll give you my code …

[code][/code]

Show me the code your using to save the XML file.

Happy coding.

Let me get this right …

You want to be able to to view the events’ details in a light box without the ability to edit or save, right?

Here’s see my version:


yes, Romeo You are correct . i will try .
Thank you very much

Hey rajeshchberolu, you seem to have some errors in the code you posted:

The one you posted was:

function calendarInit() { scheduler.config.xml_date = "%Y-%m-%d %H:%i"; scheduler.config.details_on_create = true; scheduler.config.details_on_dblclick = true; scheduler.config.prevent_cache=true; scheduler.init('scheduler_here', new Date(), "month"); scheduler.load(jQuery.url.getChatURL("/calendar/eventsXml.do")); //scheduler.toPDF(jQuery.url.getChatURL("/calendar/eventsXml.do"),'gray'); scheduler.attachEvent("onBeforeDrag", function () { return false; }) scheduler.attachEvent("onClick", function () { return false; }) scheduler.config.details_on_dblclick = true; scheduler.config.dblclick_create = false; }

Try this one. I’ve made some changes I’ll tell them to you as comments:

[code]function calendarInit() {
scheduler.config.xml_date = “%Y-%m-%d %H:%i”;

   //----- These 2 lines must be deleted since they contradict with the last 2 -----
   //scheduler.config.details_on_create = true;
   //scheduler.config.details_on_dblclick = true;

   scheduler.config.prevent_cache=true;
   scheduler.init('scheduler_here', new Date(), "month");
   scheduler.load(jQuery.url.getChatURL("/calendar/eventsXml.do"));

    //scheduler.toPDF(jQuery.url.getChatURL("/calendar/eventsXml.do"),'gray');

   scheduler.attachEvent("onBeforeDrag", function () { return false; })
   scheduler.attachEvent("onClick", function () { return false; })
   scheduler.config.details_on_dblclick = true;
   scheduler.config.dblclick_create = false;
     }[/code]

Try it and reply. Waiting.

Happy Coding.

Hi Romeo ,
in error console i am getting error message , may that one is the issue for not comming

Error: K is undefined
Source File: localhost:8080/ems/scripts/calen … eadonly.js
Line: 51

What code is placed in line 51 ?

Show it please.