Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a JavaScript pop-up calendar in an editable grid DTC

Status
Not open for further replies.

david7777777777

Programmer
Sep 26, 2001
417
US
Merlin,
You've helped me make the Grid DTC editable in Visual InterDev, and you've shown me how to implement a JavaScript pop-up calendar to use for date data entry fields in a form. Now I'd like to combine those two features. I'm trying to figure it out as we speak, but I also wanted to ask you for your input or some hints as to how I can make the pop-up calendar available beside a cell in the editable grid. Thanks for everything.
 
Merlin,
I figured it out. I used your this.Edit('Edit') trick in the grid and played around with it until I got it working. Here's the exact code for that column in the grid:

=this.anchor('<a href=&quot;javascript:;&quot; onclick=&quot;DisplayCal(document.thisForm.txtDateReceived, event);&quot; onFocus=&quot;if(this.blur)this.blur()&quot;><img src=&quot;cal.gif&quot; border=&quot;0&quot; alt=&quot;Open Calendar&quot; width=&quot;16&quot; height=&quot;15&quot; zindex=&quot;0&quot;></A>')
 
There is/was a bug in the calendar code - it uses the JavaScript modulo function for limiting the months to the range 0-11. (JavaScript months and days start at 0!)
Unfortunately, I used modulo 11 respectively, it should be modulo 12 - of course.

function getMonthName(i_nMnth, i_bShort) {
var name = m_calMonths[Math.abs(i_nMnth % 12)];

if(i_bShort)
return name.substr(0,3);
else
return name;

}
(Content Management)
 
Are you saying I need to replace some calendar code with the code you've placed here? If so could you please tell me exactly where I need to place this new code? Thanks for everything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top