Closed ProvoK closed 8 years ago
Do you have jquery ui datepicker included on your page?
I included scripts as in yours showcase demo here's the code `
<link rel="stylesheet" type="text/css" href="scripts/resources/primeui.css" />
<script src="scripts/node_modules/es6-shim/es6-shim.min.js"></script>
<script src="scripts/node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="scripts/node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="scripts/node_modules/systemjs/dist/system.src.js"></script>
<script src="scripts/resources/jquery.js"></script>
<script src="scripts/resources/jquery-ui.js"></script>
<script src="scripts/resources/primeui.js"></script>
<script src="scripts/node_modules/rxjs/bundles/Rx.js"></script>
<script src="scripts/node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="scripts/node_modules/angular2/bundles/router.dev.js"></script>
`
I tried this too `
<link rel="stylesheet" type="text/css" href="scripts/resources/primeui.css" />
<script src="scripts/node_modules/es6-shim/es6-shim.min.js"></script>
<script src="scripts/node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="scripts/node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="scripts/node_modules/systemjs/dist/system.src.js"></script>
<script src="scripts/node_modules/jquery/dist/jquery.js"></script>
<script src="scripts/node_modules/jquery-ui/jquery-ui.js"></script>
<script src="scripts/node_modules/jquery-ui/datepicker.js"></script>
<script src="scripts/resources/primeui.js"></script>
<script src="scripts/node_modules/rxjs/bundles/Rx.js"></script>
<script src="scripts/node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="scripts/node_modules/angular2/bundles/router.dev.js"></script>
`
After installing jquery and jquery-ui with npm, but now i got more errors
The ones in npm is a modified version to be used with a common loader, since you use script tags, you need the original ones, here are the links;
https://github.com/primefaces/primeng/blob/master/showcase/resources/js/jquery.js https://github.com/primefaces/primeng/blob/master/showcase/resources/js/jquery-ui.js
jquery.js is nothing special, jquery-ui.js is shrinked version that contains only what is necessary like core+datepicker. Please try with these files.
I downloaded the new resources and now it works fine! Thanks a lot
Glad to hear!
Thanks again for fast support. I suggest to include those resources in the npm install of primeng
We've done some changes lately on primeui site of things to generate primeui-ng.css and primeui-ng.js that basically includes everything ng needs to avoid issues like this one in future. Documentation will also be updated tomorrow with 0.7.
Calendar component raise an exception when used "EXCEPTION: TypeError: jQuery(...).datepicker is not a function"
html template (partial)
<p-calendar [(value)]="dateValue" [inline]="true" > </p-calendar>
ts
` import { SelectItem, Calendar } from "primeng/primeng" @Component ({ selector: "register-component", templateUrl: "scripts/apps/AuthenticationApp/templates/register.component.html", directives : [Password, InputText, Fieldset, Dropdown, Calendar] }) export class RegisterComponent implements OnInit { countries: SelectItem[]; dateValue:string; constructor () {}
} `