Board Logo

Idea
daveinsurgent - 2/1/2010 at 06:05 PM

I needed to use a different directory for images. I specified the optional parameter, and I started getting undefined errors (months was undefined).

I modified/added this block to the constructor

Code:

if (!a_tpl)
a_tpl = A_TCALDEF;
else {
for (var key in A_TCALDEF) {
if (!a_tpl[key]) {
a_tpl[key] = A_TCALDEF[key];
}
}
}

So if I specify a_tpl but not all the customizations (e.g. just the imgpath) it will still pull the defaults from A_TECALDEF.

Hope this helps.


paladin - 5/6/2010 at 08:05 AM

I needed to set the image directory in my project as well. This is how I did it - preset A_TCALDEF.imgpath.


<SCRIPT type="text/javaScript" src="$SCR_PATH/calendar_dbx.js"></script>
:
:
<script...>

A_TCALDEF.imgpath = '../../img/';

var oSTARTDATE; // to hold date object ref when created...
</script>
:
:
<td>
<input class="dateInput" type="text" name="startdate" id="startdate" value="" />
<script type="text/javascript" language="javascript">
oSTARTDATE = new tcal ( { 'formname': 'PAGEFORM'
, 'controlname': 'startdate'} );
</script>
</td>
:
:


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/