Hi,

do not set hasDatepicker css class in your override. just setting
date_picker css class should work.

--
Volker

On Mar 22, 10:44 pm, "Blyth, Mike" <[email protected]> wrote:
> I've been using jQuery UI Datepicker all along with ActiveScaffold and
> have had no problems. Now I'm overriding an input form with my own
> custom form (see below) and am having problems. What is the best way to
> do this?
>
> First I tried just including various combinations of classes on the
> input to match 'text-input date_picker hasDatepicker date-input' which I
> see on ActiveScaffold forms. That did not do anything.
>
> Then I added this to application.js:
>
>     $(".datepicker").live("click", function(){
>
>         $(this).datepicker();
>
>       });
>
> and used the datepicker class, not to conflict with ActiveScaffold's
> date_picker. This works fine except that the widget does not pop up
> until I have clicked the input, clicked any other input, then clicked
> the input again. If I throw in a style change like making a red border,
> that works on the first click, so I know the script is picking up the
> first click and calling datepicker, but somehow it does not do anything.
> Wrapping the function in $(function() { }); does not make any
> difference. The form is contained within a div with
> class='active-scaffold', but this seems not to matter either. Once the
> picker has appeared and is closed, a single click is enough to
> re-activate it.
>
> So,
>
> *         Is there a way to attach Datepicker to my own forms without
> adding any Javascript, given that it is working in
> ActiveScaffold-generated forms?
>
> *         If not, any ideas about why the first click is not working?
>
> Thanks.
>
> --Mike Blyth
>
> Form I'm using:
>
> .active-scaffold
>
>   %h4 Create a travel plan
>
>   .new_travel
>
>     = form_for :record, :url => { :action => "create" } do |form|
>
>       .traveler_names
>
>         = render 'shared/error_messages', :object => @record
>
>         = form.label :member,"", :class=>'required'
>
>         %br
>
>         = form.collection_select(:member,
>
>           Member.select("last_name, first_name, middle_name, short_name,
> name, id").order("name"),
>
>           :id, :name, {}, :multiple=>true)    
>
>         %br
>
>         = form.label :other_travelers, "Travelers not listed above"
>
>         %br
>
>         = form.text_field :other_travelers, :class =>
> 'other_travelers-input'
>
>       .travel_date        
>
>         = form.label :date, :class=>'required'
>
>         %br
>
>         = form.text_field :date, :class => 'date-input datepicker '

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to