[ 7 posts ]

valined

  • Joined: Thu Jan 27, 2011 12:34 am
  • Posts: 4
  • Offline
  • Profile

Calendar cannot be extended?

Post Posted: Fri Jan 28, 2011 12:10 am
+0-
Hi,

I'm trying to extend the Calendar control but I'm getting an error saying 'extend failed, please check that all dependencies are included'.
Here is my code:
Code:
   YAHOO.namespace("custom");
   YAHOO.lang.extend(YAHOO.custom.Calendar, YAHOO.widget.Calendar);

   YAHOO.custom.Calendar = function(id, containerId, options) {
      YAHOO.custom.Calendar.superclass.constructor.call(this, id ||       YAHOO.util.Dom.generateId(), containerId, options );
   };
      
   YAHOO.custom.init = function() {
      YAHOO.custom.cal1 = new YAHOO.custom.Calendar("cal1","cal1Container");
      YAHOO.custom.cal1.render();
   };
      
   YAHOO.util.Event.onDOMReady(YAHOO.custom.init);

My dependencies are: yahoo.js, event.js, dom.js and calendar.js. I'm using YUI 2.8.2.

Is there something I missed/done wrong?
Thanks.

Alberto Santini

YUI Contributor

  • Offline
  • Profile
Tags:

Re: Calendar cannot be extended?

Post Posted: Fri Jan 28, 2011 2:48 pm
+0-
Hello valined.

I noted you extend the custom calendar before you defined it.

Did you try to move the extend statement after the definition of custom calendar?

YAHOO.custom.Calendar = function(id, containerId, options) {
...
YAHOO.lang.extend(YAHOO.custom.Calendar, YAHOO.widget.Calendar);

Regards,
IceBox

valined

  • Joined: Thu Jan 27, 2011 12:34 am
  • Posts: 4
  • Offline
  • Profile
Tags:

Re: Calendar cannot be extended?

Post Posted: Mon Jan 31, 2011 12:17 am
+0-
icebox,

Of course you're right. What was I thinking? Moving the extend() call after the calendar definition fixed the problem.

Thanks.

Pavel Pozdeev

  • Username: pasharik
  • Joined: Fri Feb 03, 2012 1:38 am
  • Posts: 1
  • Offline
  • Profile

Re: Calendar cannot be extended?

Post Posted: Fri Feb 03, 2012 1:45 am
+0-
Hello, I have similar problem, but with YAHOO.widget.DataTable element. My code:
Code:
   YAHOO.namespace("yuiblog.widget");
   YAHOO.yuiblog.widget.DataView = function(elContainer , oColumnSet , oDataSource , oConfigs) {
       if (arguments.length > 0) {
              YAHOO.yuiblog.widget.DataView.superclass.constructor.call(this, elContainer , oColumnSet , oDataSource , oConfigs);
         }
   };
YAHOO.lang.extend(YAHOO.yuiblog.widget.DataView, YAHOO.widget.DataTable);


And I have an error: "extend failed, please check that all dependencies are included"
If I try to extend from Calendar class, for example:
Code:
YAHOO.lang.extend(YAHOO.yuiblog.widget.DataView, YAHOO.widget.Calendar);

all work right. What I do wrong? Thanks

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: Calendar cannot be extended?

Post Posted: Fri Feb 03, 2012 10:20 am
+0-
Hello Pavel.

I suppose your reference is this one:
http://www.yuiblog.com/blog/2007/04/23/dataview/

Well, if you use the same seed files (2.3.1), it should work fine.

You are welcome to update that example for the latest YUI.

Regards,

IceBox

Lanny Danenberg

  • Username: tandy4sig
  • Joined: Fri Feb 03, 2012 2:37 pm
  • Posts: 1
  • Offline
  • Profile
Tags:

Re: Calendar cannot be extended?

Post Posted: Fri Feb 03, 2012 5:07 pm
+0-
Thanks for the input. Very good. Where are you from in Italy? I have been to Milano, Florence and Venice. Italy is my favorite place and look forward to going back. The people are friendly and HAPPY.

virtuemart1

  • Username: virtuemart1
  • Joined: Wed Feb 08, 2012 8:53 pm
  • Posts: 1
  • Offline
  • Profile
Tags:

Re: Calendar cannot be extended?

Post Posted: Wed Feb 08, 2012 11:16 pm
+0-
This is my FIRST post in this forum so please be gentle.

There are quite many calendar examples and I read through the quick start one. I simply copy the source and it works!
http://developer.yahoo.com/yui/examples ... clean.html

What I want now is:
text input, when mouse click the text input, popup the calendar like the image below. Anyone know howto?
  [ 7 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum