2

I have a model bound to grid.MVC, every other filter works fine apart from the date picker filter.

I have added the grid.mvc.datepicker.css to the bundle and I am getting the date picker.

enter image description here

There are no errors in any of the js and all the js files load properly

And this is how I initiate the column in the view

columns.Add(o => o.VoucherType.Expiry)
    .Titled("Expiry")
    .SetFilterWidgetType("")
    .Format("{0:dd/MM/yyyy}");

When I click on the date , nothing happens to the grid.

Tushar
  • 85,780
  • 21
  • 159
  • 179
Bajju
  • 925
  • 11
  • 27

2 Answers2

2

The problem is not that you have forgotten to add the bootstrap.min.js or the bootstrap-datepicker.js but that you have not added the CSS file to the _Layout partial of your application.

I had this problem too, when I installed Grid.MVC the javascript got put in the right place, but I forgot to look in my /Content/ folder and drag the gridmvc.datepicker.min.css file onto my _Layout. After I did that it rendered fine.

I hope this solves your problem.

Kyle Bachmann
  • 326
  • 3
  • 16
1

I was able to reproduce the problem you are experiencing.

Since Grid.MVC is based on bootstrap you need to include the following bootstrap scripts in your solution:

  1. bootstrap.min.js
  2. bootstrap-datepicker.js.

I reproduced your problem by removing the bootstrap-datepicker.js from my solution includes.

Thank you

Shadowind
  • 114
  • 3
  • Thanks Shadowind , will try and let u know if this works – Bajju Jan 26 '16 at 22:28
  • Any idea how would it work for datetime not just date bz the filter conditions don't work correctly with datetime. Since the question is very close so not posting a separate question – singhswat Sep 28 '16 at 10:50