datepicker js code is not loaded for ajax templates

  placeholder addeventph addEvent() 

  define ajax addEvent(){
    var e := Event{ start := now() end := now()}
    form{
      labelblock("Title: "){ input(e.title) }
      labelblock("Start: "){ input(e.start) }
      labelblock("End: "){ input(e.end) }
      submit action{ e.save(); } {"save"}
    } 
  }

results in a javascript error: $(“input[name=….]”).datetimepicker is not a function

Submitted by Danny Groenewegen on 23 August 2011 at 14:01

On 23 August 2011 at 14:31 Danny Groenewegen commented:

workaround: manually load the required javascript/css in the page (see definition of input(DateTime) in built-in.app):

    includeJS("jquery-1.5.min.js")
    includeJS("jquery-ui-1.8.9.custom.min.js")
    includeJS("jquery-ui-timepicker-addon.js")
    includeCSS("jquery-ui.css")
    includeCSS("jquery-ui-timepicker-addon.css")

On 23 August 2011 at 15:03 Danny Groenewegen tagged 1.2.9

On 14 September 2011 at 13:34 Danny Groenewegen commented:

this is related to the placeholder’s render-as-ajax mode (further requests, such as a form in the ajax template, submit to the ajax template directly):

placeholder addeventph addEvent()

as opposed to

placeholder addeventph { addEvent() }

which only has addEvent() as the default contents (further requests still go to the page)

any includeJS/includeCSS is affected by this problem


On 24 February 2012 at 17:02 Danny Groenewegen tagged 1.3.0

On 24 February 2012 at 17:02 Danny Groenewegen removed tag 1.2.9

On 15 January 2013 at 14:33 Danny Groenewegen tagged confirmed

On 15 January 2013 at 14:33 Danny Groenewegen removed tag 1.3.0

Log in to post comments