Perhaps consider this other scala JSON lib:

http://github.com/jonifreeman/literaljson/tree/master

NB: I've not used this, im just adding it for discussion as it might
help you.

Cheers, Tim

On Jul 10, 9:44 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> "marius d." <marius.dan...@gmail.com> writes:
> > Please take a look on JsObj.
>
> That's what I'm using now and it's a pain:
>
> def generateOptions = JsObj(
>       ("title", "My title"),
>       ("series", JsArray(JsObj(("Label","MyLabel")))),
>       ("seriesColors", JsArray("#000000","#cccccc")),
>       ("axes", JsObj(
>                 ("xaxis", JsObj(
>                   ("renderer", JsVar("$.jqplot.CategoryAxisRenderer")),
>                   ("ticks", JsArray(data.flatMap(series => 
> {series.labels.map(v => v.toString)}) : _*))
>                 )),
>                 ("yaxis", JsObj(
>                   ("min", 0),
>                   ("tickOptions", JsObj(
>                     ("formatString", "%d")
>                   ))
>                 ))
>         )),
>       ("seriesDefaults", JsObj(
>         ("renderer", JsVar("$.jqplot.BarRenderer")),
>         ("rendererOptions", JsObj(
>                 ("barDirection", "horizontal"),
>                 ("barPadding", 8),
>                 ("barMargin",20),
>                 ("barWidth", 20)
>         ))
>
>       )))
>
> > But what is your exact use case? ...  generate JSON constructs from
> > Scala and send then to browser?
>
> Yes, I want the above JSON object (which is just a subset of the full
> capabilities) to be generated in Scala, so I:
>
> - will get typechecking
> - Don't have to remember field names
> - Can't get autocompletion on valid values for things like
> - e.g. barDirection
>
> /Jeppe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to