Skip to main content
animation added.
Source Link
andre314
  • 19k
  • 1
  • 37
  • 73

Try this.

data = Map[<|"id" -> #, "T1" -> #, "T2" -> # + 1|> &, Range[40]];

createViewDb[Dynamic@output_, Dynamic@selected_,Dynamic@data_] := 
(selected = Table[True, {i, 1, Length@data}];
DynamicWrapper[
Dataset[Query[All, 
   KeySort@<|#, "" -> Checkbox[Dynamic@selected[[#id]]]|> &]@
  data], output = Query[Select[TrueQ@selected[[#id]] &]]@data]);

Column[{createViewDb[Dynamic@output, Dynamic@selected, Dynamic@data], 
Dynamic@selected, Dynamic@Dataset@output}]

Note the annoying behaviour of Dynamic@Dataset@output when displaying the output. This is why I avoided putting Dynamic around Dataset in createViewDb.

enter image description here

Try this.

data = Map[<|"id" -> #, "T1" -> #, "T2" -> # + 1|> &, Range[40]];

createViewDb[Dynamic@output_, Dynamic@selected_,Dynamic@data_] := 
(selected = Table[True, {i, 1, Length@data}];
DynamicWrapper[
Dataset[Query[All, 
   KeySort@<|#, "" -> Checkbox[Dynamic@selected[[#id]]]|> &]@
  data], output = Query[Select[TrueQ@selected[[#id]] &]]@data]);

Column[{createViewDb[Dynamic@output, Dynamic@selected, Dynamic@data], 
Dynamic@selected, Dynamic@Dataset@output}]

Note the annoying behaviour of Dynamic@Dataset@output when displaying the output. This is why I avoided putting Dynamic around Dataset in createViewDb.

Try this.

data = Map[<|"id" -> #, "T1" -> #, "T2" -> # + 1|> &, Range[40]];

createViewDb[Dynamic@output_, Dynamic@selected_,Dynamic@data_] := 
(selected = Table[True, {i, 1, Length@data}];
DynamicWrapper[
Dataset[Query[All, 
   KeySort@<|#, "" -> Checkbox[Dynamic@selected[[#id]]]|> &]@
  data], output = Query[Select[TrueQ@selected[[#id]] &]]@data]);

Column[{createViewDb[Dynamic@output, Dynamic@selected, Dynamic@data], 
Dynamic@selected, Dynamic@Dataset@output}]

Note the annoying behaviour of Dynamic@Dataset@output when displaying the output. This is why I avoided putting Dynamic around Dataset in createViewDb.

enter image description here

Source Link

Try this.

data = Map[<|"id" -> #, "T1" -> #, "T2" -> # + 1|> &, Range[40]];

createViewDb[Dynamic@output_, Dynamic@selected_,Dynamic@data_] := 
(selected = Table[True, {i, 1, Length@data}];
DynamicWrapper[
Dataset[Query[All, 
   KeySort@<|#, "" -> Checkbox[Dynamic@selected[[#id]]]|> &]@
  data], output = Query[Select[TrueQ@selected[[#id]] &]]@data]);

Column[{createViewDb[Dynamic@output, Dynamic@selected, Dynamic@data], 
Dynamic@selected, Dynamic@Dataset@output}]

Note the annoying behaviour of Dynamic@Dataset@output when displaying the output. This is why I avoided putting Dynamic around Dataset in createViewDb.