Data List: How to set value programmatically? #236
Replies: 2 comments
-
Hey @leekelleher, i've gottan a bit further since my post. this is the json data that I need: When copy pasting this in: It works. But weirdly enough it doesn't work when doing this:
Any idea? |
Beta Was this translation helpful? Give feedback.
-
@Sven883 Thanks for posting this. There is quite a bit to unpack from your code snippets. My general approach would be to try to simplify the value of the data-source items. From your code snippet examples, you are serializing a new When I've been working with content node data-sources for Data List, I try to use the node's Here's an example of how I do that here: https://github.com/leekelleher/umbraco-contentment/blob/1.4.4/src/Umbraco.Community.Contentment/DataEditors/DataList/DataSources/UmbracoContentXPathDataListSource.cs#L121-L123 However, if you are determined to have the serialized JSON-string as the I hope this helps? |
Beta Was this translation helpful? Give feedback.
-
Which Contentment version are you using?
V1.4.4
Which Umbraco version are you using? For example: 8.14.1 - don't just write v8
v8.6.1
Bug summary
I've got 2 custom propertyeditors made:
I created a custom app_plugin so products with old filtering are parsed to new filtering with above new slider & checkboxes.
Problem i'm having is that either way how I try to set the value, the value is always empty in the backoffice:
I've tried setting the value like this:
But that doesn't work. Ive also tried returning a array of only the names, but same result.
For the sliderFilter i've created a custom model:
I've tried adding the value with/without serializing, but no results.
Any idea would be greatly appreciated!
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions