[Cubicweb] cubicweb / jquery / wdcalendar / fullcalendar

Adrien Di Mascio adrien.dimascio at logilab.fr
Mon Aug 9 08:13:14 CEST 2010


Hi Carlos,

On 06/08/2010 22:17, Carlos Balderas wrote:
> Does anyone has used these jquery plugins in cubicweb?:
>
> * wdCalendar
> (http://www.web-delicious.com/jquery-plugins-demo/wdCalendar/sample.php)
> * fullcalendar (http://arshaw.com/fullcalendar/)

As far as i know, we haven't use them for the moment, but this is 
definitely something we've been thinking about.

> they seem to be great plugins.
>
> I was trying to use it in a cubicweb view but I keep getting this jquery
> error:
>
> ***********************************************
> [Exception... "Component returned failure code: 0x80004003
> (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]"  nsresult:
> "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
> http://debian:8080/data/jquery.js :: anonymous :: line 12"  data: no]
> http://debian:8080/data/jquery.js
> Line 12
> ***********************************************

I would say this is a XHTML problem. More precisely, when the HTTP 
server (cubicweb) serves pages with the application/xhtml+xml content 
type, browser behave differently and the DOM API and structure is not 
exactly the same as when serving pure html content. As a simple test, 
you could edit your 'all-in-one.conf' file and change / set the 
following setting :

   force-html-content-type=yes

If the error disappear, the problem is confirmed. Then, if you don't 
want to serve html pages for your whole application, but only for your 
calendar views, use the following instruction in your view (in call() or 
cell_call()) :

   self._cw.demote_to_html()

 > If anyone has started to work on this, I will be very happy to
 > participate if possible =).

As I said, I'm not aware of something having been implemented. However, 
if you're interested, we would be more than glad to help you.

I think that one of the first thing to be done is to change the way our 
calendar view behave : we are currently generating html views but we 
should expose the data itself, i.e. events (ICalendarable objects) 
published in json, xml or ical format. Urls like rql=YOUR QUERY?vid=json 
or ?vid=_your_format_goes_here might be enough, i don't know.

Hope this helps.
-- 
Adrien Di Mascio - LOGILAB, Paris (France).
Tél: 01.45.32.03.12
Formations - http://www.logilab.fr/formations
Développements - http://www.logilab.fr/services
Gestion de connaissances - http://www.cubicweb.org/



More information about the Cubicweb mailing list