-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I want to implement a derived version of the Datebox component where only certain dates should be selectable. Could you please give some advice to me where I should look into to find the place where the content of the Calendar is rendered? I guess this would be the place where to check if a single day should be a link (selectable) or only a simple text (not selectable).
Best regards,
Ralf.
take a look at this:
<window> between 2007/12/03~2007/12/25 : <datebox constraint="between 20071225 and 20071203"/><separator/> before 2007/12/25 : <datebox constraint="before 20071225"/><separator/> after 2007/12/03 : <datebox constraint="after 20071203"/><separator/> </window>
Unfortunately, this will not help in my case. I need a calendar where, let's say, each week every monday and friday is a valid date and all other days are not. My first thought as I read the docs about constraints was to use a custom constraint, but as far as I understood this will only be used for validating when a date is selected and written into the text field. It is not used for deciding if a day in the calendar is a link or not.
So, I looked a bit deeper into the source code and found the JavaScript file db.js. Here, I found the function _invalid of the zk.Cal class which decides if a date is valid (a link) or not.
So, my question is: Is it possible to override only this function to achieve the required behavior? And if yes, how do I have to do this in my code?
Best regards,
Ralf.
I want to ask again for any suggestions by the ZK experts:
Is there a way to override the mentioned JavaScript function in the file db.js that checks if a single date of the calender is valid or not? If yes, this would be the solution for my problem (I hope :-). I should solve this problem by end of this week or I should at least know that I can't solve it. So, any help would be appreciated.
Best regards and thanks,
Ralf.
Hi Henri,
how can this be done for the _invalid function? Will it work if I put the following code into a separate JS file:
zk.Cal.prototype = {
_invalid: function (now) {
// here comes my new code
}
}
I have not ever done this, overriding a function inside a class.
Thanks,
Ralf.
Hi Henri,
this does not work. IE says:
Error: 'zkDtbox' is undefined
And are you sure zkDtbox is the right class? In db.js it has no function _invalid. This is a function of zk.Cal.
Best regards,
Ralf.
Asked: 2008-07-08 14:51:16 +0800
Seen: 195 times
Last updated: Jul 16 '08