StippleUI.jl icon indicating copy to clipboard operation
StippleUI.jl copied to clipboard

How to easily generate dynamic content

Open cwiese opened this issue 2 years ago • 4 comments

I have a Dict in the model (that can change)

Stipple.@kwdef mutable struct Model <: ReactiveModel
  params::R{Dict} = Dict{String, Any}("T_max" => 310.0, "n_segs" => "10", "l_tube" => 10.0, "T_ambient_res" => "Ambient Temperature is 100.0K")
end 

in the UI - would like to create many textfield ..and rerender when model changes

[cell(class="q-pa-sm", textfield("", Symbol(""params['$k']"""), label="$k")) for (k,v) in @bind(:params)]  

Obviously @bind(:params)] does not work.

I was hoping not to create a giant HTML string in the model - but rather use this like a template.

Any ideas

Chuck

cwiese avatar Dec 04 '21 00:12 cwiese