Then I am creating Partial view which has sample angularJS inside.
but I am getting "angular not defined". Is there something wrong in referencing Umbraco angular module. What I need to do to make code work ? Since I am getting angular error, I have reference angularJS seperately. Is this correct way working with Umbraco and AngularJS.
{
@model Umbraco.Forms.Mvc.Models.FieldViewModel
@{
string val = Model.Values.LastOrDefault()?.ToString() ?? string.Empty;
if (Model.ValueAsObject != null && !Equals(Model.ValueAsObject, string.Empty))
{
try
{
DateTime d;
d = (DateTime) Model.ValueAsObject;
val = d.ToShortDateString();
}
catch {
//ignore
}
}
}
I have requirement to include Date picker control as custom field in Umbraco forms.
So, Existing date picker has to be extended with some javascript functionality (JQuery or Angular or Vue). Sample as per link below
Now, I am facing error with AngularJS first line (angular not defined). So any guidance on
How to develop custom field type with AngularJS controls
Is there any date range picker in Umbraco ?
There is already umb-date-time-picker control available in back office which uses umbraco angular model. But not sure how to integrate it with Custom field type.
How to include AngularJS on non-backoffice features (though back office is technically asp.net route in same web site)
As per link, I can see Pikaday calendar (js and css) is included in Form Asset folder.
Also, I found one more library under Umbraco/asset for Calendar/DatePicker being used called "BaremetricsCalendar".
I am not sure whether is documented in Umbraco on how to use it, but then there is documentation available on
Multi range date picker in umbraco forms
Hi,
I have a requirement to create multi range date picker as custom field or data type and make it available under umbraco forms.
Details are
Looking for some guidance from Umbraco experts.
Hi Andand,
There's documentation that will help you with creating a custom field type:
https://our.umbraco.com/documentation/add-ons/umbracoforms/developer/Extending/
I hope this helps.
Hi Breden,
I have created custom field control class in C# as per link
https://our.umbraco.com/documentation/add-ons/umbracoforms/developer/Extending/Adding-a-Fieldtype
Then I am creating Partial view which has sample angularJS inside. but I am getting "angular not defined". Is there something wrong in referencing Umbraco angular module. What I need to do to make code work ? Since I am getting angular error, I have reference angularJS seperately. Is this correct way working with Umbraco and AngularJS.
{ @model Umbraco.Forms.Mvc.Models.FieldViewModel @{ string val = Model.Values.LastOrDefault()?.ToString() ?? string.Empty; if (Model.ValueAsObject != null && !Equals(Model.ValueAsObject, string.Empty)) { try { DateTime d; d = (DateTime) Model.ValueAsObject; val = d.ToShortDateString(); } catch { //ignore } } }
{
Last Name:
Result: {{fname+''+lname}}
} }
Angular is only available on your website if you include it.
Umbraco uses AngularJS in the back office (admin) area. In the link I sent you'll see Angular isn't referenced anywhere.
I'm not sure what you are trying to do with Angular and whether it is needed?
Hi Breden,
I have requirement to include Date picker control as custom field in Umbraco forms. So, Existing date picker has to be extended with some javascript functionality (JQuery or Angular or Vue). Sample as per link below
https://material.angularjs.org/latest/demo/datepicker
Now, I am facing error with AngularJS first line (angular not defined). So any guidance on
Thanks,
Anand Bhopale
It seems like JQuery or AlpineJS would be a better fit for what you're trying to do if #2 above doesn't work out for you.
Thanks Brendan for your help.
As per link, I can see Pikaday calendar (js and css) is included in Form Asset folder.
Also, I found one more library under Umbraco/asset for Calendar/DatePicker being used called "BaremetricsCalendar". I am not sure whether is documented in Umbraco on how to use it, but then there is documentation available on
https://github.com/Baremetrics/calendar
So, I think I can explore more on how to integrate it with Forms.
Is this recommended way I have include front end javascript library (Vue or JQuery UI) under App_plugin Folders ?
Btw, thanks for reminding me on AngularJS end of support. :-)
Just include the link in the master page/template to the library as you would normally do.
Hi Brendan,
I have developed by DateRange Control using Pikaday.
Html code
and javascript is
But when I am submitting my umbraco form, I am getting blank value. The value is available in textbox before submtting the form.
Any clue ?
I'm not sure Anand.
It seems like the binding isn't right.
Have a look at the DatePicker field type (Partials/Forms/FieldTypes/FieldType.DatePicker.cshtml) in Umbraco, here's the code:
Thank Brendan,
I have made the changes in the control and now everything is working as expected
is working on a reply...