Hello,
While trying to use the igDatePicker and trying to set options I keep getting errors.
$("#date-from").igDatePicker({ width: "250px", dateDisplayFormat: "dd/MM/yy", nullable: false, value: new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate())
});
TypeScript throws the following error:
Error TS2345 Argument of type '{ [x: number]: undefined; width: string; dateDisplayFormat: string; nullable: boolean; value: Dat...' is not assignable to parameter of type 'string'.
The only options that do seem to work are the not inherited ones (according to http://help.infragistics.com/jQuery/2014.2/ui.igdatepicker)
So I think the typings file (igniteui.d.ts) may be missing some options? Or am I doing something wrong?
I am using IgniteUI 20142.2477 and typescript 1.6.
Thank you!
Hello Michael,
Thank you for contacting Infragistics!
I created a sample igDatePicker with the options you mention and it runs without issue. I am using version 14.2.20142.2477 in Infragistics Ignite UI for jQuery 2014 Volume 2. I am attaching my sample to this can you run the sample and let me know what behavior you see. Can you please provide isolated sample application that demonstrates the behavior you are seeing?
Note I removed the JS and CSS files so you will want to replace them before running the sample.
Hello Mike P,
The problem is not that the Javascript doesn't work, the problem is that the TypeScript does not compile to Javascript because it does not recognize those properties. They should be set in the typings file (igniteui.d.ts). (see http://www.infragistics.com/community/blogs/angel_todorov/archive/2012/10/27/introducing-typescript-support-for-ignite-ui.aspx)
I have included a small MVC.Net project with the exception as shown in my post. The file with the error is: home.index.ts.
MVC.Net project: http://www.filedropper.com/igdatepicker
Note: This project is created in Visual Studio and TypeScript 1.6.
Thank you.
Thank you for the update. I am unable to download that file. The link just takes me to the main page for file dropper. Can you please instead attach that file to this case? You will have to delete the packages folder before attaching as well as the debug/release folders.
My apologies for the inconvenience. I have attached the file below.
Thank you,
Thank you for the update and sample. I have done some looking into this matter. First I have been unable to run your sample as it won’t build. I did look at your code for the igDatePicker using type script and you appear to be missing a few things. It appears you are not referenceing all the proper scripts. I recommend you go over the following sample and documentation on how to use typescript with the Ignite UI controls:
http://www.igniteui.com/editors/typescript
http://www.igniteui.com/help/using-ignite-ui-with-typescript
I also noticed that you appear to both be using the MVC wrappers and typescript I would recommend you use on or the other. I would also recommend that you load the scripts required to use the igDatePicker without using the igLoader.