Umb 7.2.1, I need to create a dropdown dataType that allows the setting of Text and Value separately. Working through various property editor tutorials but would like to see the controller.js and package.manifest for the existing dropdown dataType so I can work out how the "Add" button works in the multivalues.html prevalue editor.
I can't find them anywhere. I guess they could be buried or possibly in a binary, I don't know what the possibilities are. If anyone could tell me where to find them I'd appreciate it :)
I have not had a look for them but was wondering if you could perhaps share your code? I imagine it's a matter of keeping track of an object and make sure to populate it with date whenever a new row is added?
I was just looking at them thanks. Quite like the look of the JSON Dropdown Picker so I'm giving that a go. What I really wanted though was to be able to add data progressivly in the UI rather than have to maintain and upload an extermal file or DB. This is only the first part of the creation of a larger ArcheType grid. It's to allow the editors to set a code from a list of about a hundred friendly names, then set up other stuff per code, adding as many as they need.
JSON file created though now so I'll see how it goes.
Hi Craig, just guessing here, but maybe try with your Json file in the root to begin with, just in case it's something to do with that url not being served ?
Aha, it now works:) Thanks for that. However, I can't have this data available to snoopers, so how do I get it to serve from App_Data, which is where I'd expect to put Data:) ?
I just tried saving it with ~/App_Data/MyFile.json and got an error saying "A pre value with the Alias dataSource already exists for this data type", which was interesting.
Just for the record, the entries to get it to work were:-
Url:~ /App_Data/MyFile.json
JSONPath: $.MyRegions[*]
Key JSONPath: $..Region
Label JSONPath: $..Label
Relation Mapping: not selected
Don't know why I got the save error earlier, maybe because I had the JSON file in two places. But it's working now, proved by changing data in the JSON file and seeing it reflected in the dropdown.
Hi Robin - 'fraid I didn't. I had to "rethink" the problem. Ended up using a JSON file and nuPickers. Much more complicated than I thought was necessary for something so obvious (i.e. dropdown as you'd expect in bog-standard HTML).
Custom Dropdown Property Editor Issue
Umb 7.2.1, I need to create a dropdown dataType that allows the setting of Text and Value separately. Working through various property editor tutorials but would like to see the controller.js and package.manifest for the existing dropdown dataType so I can work out how the "Add" button works in the multivalues.html prevalue editor.
I can't find them anywhere. I guess they could be buried or possibly in a binary, I don't know what the possibilities are. If anyone could tell me where to find them I'd appreciate it :)
Craig
Hi Craig
I have not had a look for them but was wondering if you could perhaps share your code? I imagine it's a matter of keeping track of an object and make sure to populate it with date whenever a new row is added?
But perhaps you can browse through the source code to see if you can find what you're looking for here https://github.com/umbraco/Umbraco-CMS/search?utf8=%E2%9C%93&q=dropdown+editor ?
Have you also had a look in the Angular workbook? https://github.com/umbraco/AngularWorkbook
/Jan
Just been told via Twitter the controller is here: https://github.com/umbraco/Umbraco-CMS/tree/5b9a98ad6ae9e63322c26f7b162204e34f7fcb54/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdown but the manifest is in code somewhere, which I presume means in a dll. Looking at your link Jan I think it shows it's in a .cs file.
Haven't touched Angular before and of course I'm in the inevitable rush for a deadline. Looks like I'll have to calm down and do some reading, lol
IF I manage it, I'll share the code.
Craig
I can't believe I'm the only person in history who's needed "normal" dropdown functionality. Am I missing a dataType somewhere that does this already?
Craig
Hi Craig,
There are some DropDown Pickers in nuPickers which can be wired up to a number of datasources.
How do you want to populate your Drop Down, is it the same for all instances, or do you require dynamic values ?
HTH,
Hendy
Hi Hendy,
I was just looking at them thanks. Quite like the look of the JSON Dropdown Picker so I'm giving that a go. What I really wanted though was to be able to add data progressivly in the UI rather than have to maintain and upload an extermal file or DB. This is only the first part of the creation of a larger ArcheType grid. It's to allow the editors to set a code from a list of about a hundred friendly names, then set up other stuff per code, adding as many as they need.
JSON file created though now so I'll see how it goes.
Thanks,
Craig
If my data is at /App_Data/myfile.json and looks like this:-
What do I put in JSONPath, Key JSONPath and LabelJSONPath to output the Label and Region? Assuming the URL is ~/App_Data/expansysRegions.json.
Have been testing with http://jsonpath.curiousconcept.com/ but doesn't translate to the picker.
Thanks,
Craig
Hi Craig, just guessing here, but maybe try with your Json file in the root to begin with, just in case it's something to do with that url not being served ?
Ok, put the file in the root and tried:-
Url: /MyFile.json
JSONPath: $.MyRegions[].*
Key JSONPath: Label
Label JSONPath: Region
Relation Mapping: not selected
Nothing in the dropdown.
Craig
What if you try ~/MyFile.json ?
Aha, it now works:) Thanks for that. However, I can't have this data available to snoopers, so how do I get it to serve from App_Data, which is where I'd expect to put Data:) ?
I just tried saving it with ~/App_Data/MyFile.json and got an error saying "A pre value with the Alias dataSource already exists for this data type", which was interesting.
Hi Craig, that should be an easy fix - raised an issue here
Just for the record, the entries to get it to work were:-
Url:~ /App_Data/MyFile.json
JSONPath: $.MyRegions[*]
Key JSONPath: $..Region
Label JSONPath: $..Label
Relation Mapping: not selected
Don't know why I got the save error earlier, maybe because I had the JSON file in two places. But it's working now, proved by changing data in the JSON file and seeing it reflected in the dropdown.
So job done.
Many thanks Hendy :)
Hi Craig - I'm in 'urgent' need for such a dropdown as you described your post... - how did you manage it? :)
\Robin
Hi Robin - 'fraid I didn't. I had to "rethink" the problem. Ended up using a JSON file and nuPickers. Much more complicated than I thought was necessary for something so obvious (i.e. dropdown as you'd expect in bog-standard HTML).
Good luck
is working on a reply...