Can someone help me?
How would someone use an external jquery datepicker inside a UD dashboard?
Can someone help me?
How would someone use an external jquery datepicker inside a UD dashboard?
Hi @mkellerman,
If you want to include this, and work with the relevant data from UD you need to wrap it into a custom component.
If you’re purely working clientside with the text-box then you can just include the required .js files in the -scripts param of new-uddashboard.
Remember: you need to publish your script in a UD Published folder in order to reach it.
This is what i have so far:
New-UDCard -Content { New-UDHtml -Markup @' <script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" /> <input type="text" name="daterange" value="01/01/2018 - 01/15/2018" />
'@
New-UDElement -Tag 'div' -OnMount "`$('input[name=`"daterange`"]').daterangepicker();" -Content {} -Attributes @{ display = "none"} }
Have you tried New-UDInputField with a -Type of “date”?
gav
Thanks BoSen29,
I’ll try that!
OpsEng, yes, but I want more control with the date selector. And the current date picker is kinda broken. I’ve opened an issue on github.