|
Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
Code: HTML/ASPX
<eo:PopupCalendar ID="Calendar1" runat="server" ClientSideOnSelect="DateClientSideOnSelect">...
How in function DateClientSideOnSelect(calendar, eventName) i can get DOM object of Calendar1 ? calendar.getId() - return ClientID but document.getElementById(calendar.getId() ) - return null. Also document.getElementById(<%=Calendar1.ClientID %>) return null
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
This is normal. Our PopupCalendar is not a single DHTML element, so you can not get a single element that represents the Calendar. You can only get the client side JavaScript method and call the methods that are exposed on that object (such as getId).
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
Great! :( And what i can do with Date from this PopupCalendar? What profit will i have from it?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
|
|
Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
Thanks for links. But you don't understand me. Forgive me for boring. I know EO client api and methods of Calendar class.
I create my UserControl aspx and use PopupCalendar and TextBox(display selected date). If i use single my UserControl on page, then Calendar.getSelectedDate() and set value to <%TextBox.ClientID %>.value - work fine. But if i use many UserControl on page a must define what kind calendar fire event ClientSideOnSelect and accordingly define to what kind TextBox write selectedDate.
|
|
Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
Sorry for my English :)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That will be up to you. You will need to use eo_GetObject("<%=Calendar.ClientID %>") to get the Calendar object. You can then use whatever method to associate your Calendar with your TextBox.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
if i use ClientSideOnSelect handler for example function DateClientSideOnSelect(calendar, eventName) { ... } and many usercontrol contaied Calendar, then in html source will be many unction DateClientSideOnSelect and when event fire - then be called the last function DateClientSideOnSelect.
Accordingly eo_GetObject("<%=Calendar.ClientID %>") - it's latest UserControl on Page.
Yes, i make workaround. I use Dictionary - usercontrol.clientID and Calendar.getId().. but it's not good. I think will be great add to EO Object class method getParentElement, but ofcourse it's up to you.
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Try use:
eo_GetObject("<%=Calendar.ClientID %>").getRootElement();
That should give you the root HTML element of the Calendar control. Note this is only for you to get a DHTML element in your page, it is not guaranteed that it has the same ID as the Calendar.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
PopupCalendar don't contains getRootElement(); :)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Maxim wrote:PopupCalendar don't contains getRootElement(); :) Can you try it on the latest version first? The method is there. It's not documented. Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
Worked. Thanks.
|
|