TMS Blog: FlatPickr (Part 2)

TMS Blog: FlatPickr (Part 2)

May 23, 2022

FlatPickr (Part 2). Last time out, we looked at how to incorporate FlatPickr into a TMS WEB Core project.  We had taken what might be considered the manual approach.  A link to a CDN or other source for the library is added to the Project.html file, and then a little  JavaScript code is used to manually link the library's code to an element that has been placed on a TWebForm.  This works quite well, and is typically how I use this and many other JS libraries in my projects.  But there is another way that might be more inline with how Delphi is used much of the time - by using components. So in this post, we'll revisit the same JS library, but we'll walk through how to create a component that will appear on the Delphi IDE's Component Palette.  From there, we will be able to add FlatPickr controls to any TWebForm or wherever we need the component to appear, just as easily as we do with a TWebLabel or a TWebEdit. And we'll be able to adjust many of the options that we want to pass to FlatPickr by setting properties in the Delphi IDE Object Inspector.

Enjoy this post?

Buy Andrew Simard a pizza

More from Andrew Simard