I've used datepicker from bootstrap, and I added the css and js from 
component and I removed the calendar.js component that came together how 
built-in of web2py ( came at layout.html in an of the included files )

I removed calendar.js because web2py generate same component of date when 
field of form is of date

So I could use $(".datepicker") without problems.


Em quinta-feira, 30 de junho de 2016 15:34:32 UTC-3, Michael Beller 
escreveu:
>
> arghh ... this one was a pain.  For the record:
>
> I had created a listener on the modal's show event to load the component 
> (using the code below).  Datepicker also triggers an event it calls show. 
> Since it was loading within the scope of the modal, it would trigger the 
> show listener when it was opened. After triggering another show, it would 
> use the parent URL, which replaced the page.
>
>
> I still don't fully understand (so my description may not be complete) but 
> attaching the listener to the link click event rather than the modal show 
> event solved the problem.
>
>
> On Wednesday, June 29, 2016 at 1:21:31 AM UTC-4, Michael Beller wrote:
>>
>> I'm loading an edit form in a boostrap modal 
>> using  jQuery.web2py.component().
>> I'm using bootstrap-datepicker.js for my date fields.
>> The edit form works outside the modal.
>>
>> When I load the edit form inside the modal, everything works fine except 
>> for the datepicker. When I click on the text field with the datepicker, the 
>> console shows the error below and then just replaces the entire page with 
>> just the year, e.g., "2016":
>> Synchronous XMLHttpRequest on the main thread is deprecated because of 
>> its detrimental effects to the end user's experience. For more help, 
>> check https://xhr.spec.whatwg.org/.
>>
>> I'm loading the modal with (link contains the URL):
>>       jQuery.web2py.component(link,'modal-body');
>>       $('input.date').datepicker();
>>
>> Has anybody encountered this?
>>
>> I've seen some other mentions of similar problems related to calendar.js 
>> so I don't think this is specific to datepicker.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to