Buy Now
Sign in

Checkboxes view [decode JSON]

cesarvelame , June 01 2020, 19:00
C
cesarvelame 57
June 01 2020, 19:00 #392887
Hi, I'm trying to decode this checkbox field in a view.
I used this code: item.quempode/json in the special fields on the read data but no success.
Model Name: item
Field Name: quempode
Reference: https://www.chronoengine.com/forums/posts/t104651/checkboxes-not-checked-when-loading-record
Servios.png
healyhatman 9
June 01 2020, 23:40 #392892
So you have JSON stored in an array, is that right?
If so: {var.jsonde:read_data_name.model_name.column_name}
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
R
rafaelscouto 216
November 26 2020, 03:27 #395039
I created a custom code to read data from a database, where I get the return as follows:

$ this-> data ['list_array'] = $list_array;

how can i use that json option?
admin 33
November 27 2020, 14:36 #395055
 Answer
in the Read Data in v7 use the Special fields advanced setting to auto decode a field directly in the loaded data list!
R
rafaelscouto 216
January 04 2021, 20:22 #395572
I'm trying to popularize a dropdown but I haven't seen a tutorial on how to do it on cf7.

in my table in the database, I have a column:

tab_days with the values ["1", "2" ...]

My drop-down menu looks like this:

<div class = "item" data-value = "[1,2]" data-text = "[1,1]"> ["1", "2"] </div>

how do I make it look like this:
I want to separate the items

data-value = 1 data text = 1
data-value = 2 data text = 2

...
admin 33
January 08 2021, 03:22 #395612
how did you get it to list the options in that format ?