vtfuture / BForms

Bootstrap Forms for ASP.NET MVC
MIT License
62 stars 33 forks source link

DatePicker not shows #218

Closed Pepo-BG closed 9 years ago

Pepo-BG commented 9 years ago

Hello. I tried to add a DatePicker - control, but it's not appear (have only textbox and when click on it - no datepicker shows). My code is: View:

@Html.LabelFor(m => m.Editor.Date)
@Html.BsGlyphiconAddon(BForms.Models.Glyphicon.Calendar) @Html.BsInputFor(m => m.Editor.Date, new { @class = "test" }) @Html.BsValidationFor(m => m.Editor.Date)
```


Model:
        [Required]
        [Display(Name = "Date", Prompt = "Enter Date")]
        [BsControl(BsControlType.DatePicker)]
        public BsDateTime Date { get; set; }

I'm not sure, but when I load the page, I saw 3 errors in firebug:
ReferenceError: define is not defined
....grabTemplates()})}}}})();return ich}));define("singleton-ich",["icanhaz"],funct...
(in components.js (row 339, line 1363));

ReferenceError: moment is not defined
...pl","moment","moment-calendar"],a)}else{a(window.jQuery,window.bsDatepickerRende...
(in plugins.js (row 15, line 5230));

TypeError: a is undefined
...rtable(true)}}return this.options.tags};a.widget("bforms.bsTaglist",c.prototype)...
(in widgets.js (row 1, line 73173))

My loaded JavaScript files are:
jQuery-1.10.2.js
components.js
iefix.js
plugins.js
widgets.js

Thanks!
cristipufu commented 9 years ago

Hi @BG-PR,

Please show us your javascript.

Have you included and configured the require js setup?

Pepo-BG commented 9 years ago

Hi,

No, I didn't include require js, because its optional and I think that it should work without it. Is this a problem?

Pepo-BG commented 9 years ago

Hi,

I fixed my problem with adding RequireJS and next script: $("input[type='datetime']").bsDatepicker({});

You can close the ticket.