leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
536 stars 215 forks source link

How to use bootstrap_datetimepicker #283

Closed clubbavi closed 8 years ago

clubbavi commented 8 years ago

In wice grid to pick a datepicker we can use :filter_type WiceGrid doc mentioned 4 types :rails_datetime_helper :rails_date_helper :jquery_datepicker :bootstrap_datepicker

how to use bootstrap_datetimepicker ?

for eg:-g.column :name => 'Date/Timing', :attribute => 'date', filter_type: :datetime_picker

Any help will be appreciated

Thanks

leikind commented 8 years ago

First you answer your own question listing 4 possible correct values of filter_type, and then you come up with filter_type: :datetime_picker... Where did you find datetime_picker?

It's all in the docs here and here https://github.com/leikind/wice_grid#date-and-datetime-filters and here https://github.com/leikind/wice_grid#installation

leikind commented 8 years ago

to use bootstrap_datetimepicker you have to add its support to WiceGrid first.

clubbavi commented 8 years ago

in doc it is said Bootstrap datepicker works for datetime, too. But how can I add time to the picker as in (http://eonasdan.github.io/bootstrap-datetimepicker/) if I want to use bootstrap datetime picker. How can I configure it?

leikind commented 8 years ago

Ok, I understand now. I am sorry for misunderstanding, and I am sorry for the misleading documentation.

:bootstrap_datepicker - Bootstrap datepicker (works for datetime, too)

here https://github.com/leikind/wice_grid#date-and-datetime-filters means that this picker will work if your DB column is datetime, but it doesn't mean the datepicker will show any time controls. The last time I checked Bootstrap datepicker is a date picker, and it doesn't have any time related functionality.

I will make it clearer in the docs

clubbavi commented 8 years ago

So, is it possible to add a time to the picker or add bootstrap datetimepicker dependency to the wicegrid? Any configurations I need to do to show time in the picker?

leikind commented 8 years ago

wicegrid does not support bootstrap datetimepicker

clubbavi commented 8 years ago

Ok, so currently I can use only the default time which comes in dropdown. It would be great if wicegrid supports datetime picker as well.

leikind commented 8 years ago

Yes it would be great, but I don't plan to do it. This plugin is in support mode and is looking for contributors. I accept good PRs though

clubbavi commented 8 years ago

Sure. I will try to help.