Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello Guys,
How can i create a dynamic dropdown list in Umbraco 7. This dropdown items are going to populate through webservice.
Please suggest a way through i can create a dynamic dropdownlist in Umbraco 7.
Thanks Robert
Look at using a WebApi controller to return your data as JSON which you can query via JavaScript (eg. jQuery or whatever framework you like).
Umbraco has it's own Web API controllers:
https://our.umbraco.org/documentation/Reference/Routing/WebApi/
Hi Dan,
Yes i understand that. But currently i am looking for a way to create the dropdown dynamically. I want to create my own datatype.
{ propertyEditors: [ { alias: "YouTube.CategoriesList", name: "YouTube Categories List", editor: { view: "~/App_Plugins/YouTubeCategoryDDL/categoryDDL.html" } } ] , javascript: [ "~/App_Plugins/YouTubeCategoryDDL/YouTubeCategories.controller.js" ]
}
Is this the right way?
Thanks
You may not need to create a custom property editor.
I have had great success with using nuPicker to create custom drop downs as it allows you write C# to surface the key value pair mappings.
You just need to decide on what is the key and value are and it will work out of the box.
Here is a great example of the power of using nuPicker with Flickr
I hope this helps.
Ahh, right, so you want a custom property editor with your dialogue. So, yes, you'd need to create an Angular JS view and controller for this. See https://our.umbraco.org/documentation/tutorials/Creating-a-Property-Editor/
You can then use Angular to make an HTTP request to your web-service endpoint (if it returns JSON) or a WebApi controller that wraps your service (if it's SOAP). See https://docs.angularjs.org/api/ng/service/$http
So you'd get back your data, create a select list - see https://docs.angularjs.org/api/ng/directive/ngOptions
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Dynamic DropDownList in Umbraco 7
Hello Guys,
How can i create a dynamic dropdown list in Umbraco 7. This dropdown items are going to populate through webservice.
Please suggest a way through i can create a dynamic dropdownlist in Umbraco 7.
Thanks Robert
Look at using a WebApi controller to return your data as JSON which you can query via JavaScript (eg. jQuery or whatever framework you like).
Umbraco has it's own Web API controllers:
https://our.umbraco.org/documentation/Reference/Routing/WebApi/
Hi Dan,
Yes i understand that. But currently i am looking for a way to create the dropdown dynamically. I want to create my own datatype.
}
Is this the right way?
Thanks
You may not need to create a custom property editor.
I have had great success with using nuPicker to create custom drop downs as it allows you write C# to surface the key value pair mappings.
You just need to decide on what is the key and value are and it will work out of the box.
Here is a great example of the power of using nuPicker with Flickr
I hope this helps.
Ahh, right, so you want a custom property editor with your dialogue. So, yes, you'd need to create an Angular JS view and controller for this. See https://our.umbraco.org/documentation/tutorials/Creating-a-Property-Editor/
You can then use Angular to make an HTTP request to your web-service endpoint (if it returns JSON) or a WebApi controller that wraps your service (if it's SOAP). See https://docs.angularjs.org/api/ng/service/$http
So you'd get back your data, create a select list - see https://docs.angularjs.org/api/ng/directive/ngOptions
is working on a reply...