Why don't you use the arrow syntax for pairs?

-------------------------------------
Jeppe Nejsum Madsen<[email protected]> wrote:


"marius d." <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to