Giter Site home page Giter Site logo

Comments (6)

amsul avatar amsul commented on May 5, 2024

Could you please provide a bare demo of some sort so I can see what's going on there?

from pickadate.js.

TheSisb avatar TheSisb commented on May 5, 2024

The error states that it isn't finding the DOM node. Possibilities:

a- The JS is loading before the DOM is being filled by the AJAX call
b- Your selector is wrong.

How are you triggering the JS? Some could goes a long way...

from pickadate.js.

azabaj avatar azabaj commented on May 5, 2024

So, I have a container which functions as a container to display content in an overlay:

<div id="overlay_content" style="display:none;">
  <%= yield :overlay %>
</div>

When I call new_object_path via link_to remote: true, I render content into this overlay.
new.js.erb

$('#overlay_content').html('<%=j render(partial: "ideas/new", locals: {plan: @plan, idea: @idea}) %>');
overlay_open();

I have remote forms and remote links in this rendered partial, and everything is working fine.
However when I attach pickadate I get the error I posted before:

$('input.datepicker').pickadate();

pickadate_Error

pickadate

I use:
jQuery v1.7.2
jquery_ujs for rails
modernizr 2.6.1
TinySort 1.4.29
moment.js version : 1.7.2
Livestamp.js v1.1.2
Pickadate 1.4.0

I did some trial & error and I get the same exception every time I call $('input.datepicker').pickadate(); on non-ajax rendered input elements too.
Maybe everything is fine with pickadate and there are some problem in my environment.

from pickadate.js.

azabaj avatar azabaj commented on May 5, 2024

I cleaned completely the whole layout, the problem is the same. My empty html looks like this :)

<!DOCTYPE html>
<html>
  <head>
      <title>title</title>
      <%= javascript_include_tag "application" %>
      <%= csrf_meta_tags %>

</head>
<body>

  <input type="date" class="datepicker"/>
</body>
</html>

from pickadate.js.

azabaj avatar azabaj commented on May 5, 2024

Ok, guys, I finally figured out: the problem was jquery 1.7.2. After updating to jquery 1.8.3 everything is working fine:)
Thank you!

from pickadate.js.

amsul avatar amsul commented on May 5, 2024

Great!

from pickadate.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.