logo

New Response

« Return to the main article

You are replying to:

  1. Try adding links to a $$ViewTemplate form that open the view with the grid and date parameters set.

    You can also change the look of the table by adding a stylesheet to your $$ViewTemplate form with TD and TR attributes.

    I used a combobox that contained the months. When the field value changed a JavaScript function opened a new calendar URL with the parameters set according to the values chosen.

    i.e. Select January from the combobox;

    the index of the field values in JavaScript is 1 for me as I added a "Pick a Month" Option as the first combobox value. In the onChange event for the combobox I called my viewMonth() function.

    function viewMonth(){ var f = document.forms[0]; var mon; var today = new Date(); var year = getYear(today); var i=f.Month.selectedIndex; if (i < 9) { mon = "0" + i; } else { mon = i } window.location="./SAAC?OpenForm&Grid=4&Date="+ year +"-"+ mon + "-01"; }

    function getYear(theDate) { x = theDate.getYear(); var y = x % 100; y += (y < 38) ? 2000 : 1900; return y; }

    So by picking the month I change the URL to show the calendar by month. The key is in the Grid and Date parameters.

    Grid=1 is a two day view, Grid=2 is a week long view, Grid=3 is a two week view, Grid=4 is a month view and Grid=5 is the whole year

    The Date parameter is in the format yyyy-mm-dd.

    Sorry for the late reply but this is something that a co-worker and I came up with just recently.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: