[Seaside] JQWidget nested options

Paul DeBruicker pdebruic at gmail.com
Thu Sep 1 18:06:29 UTC 2011


You need to create a Dictionary and then put that in your array

You can test it in a workplace like this:

|dict array  value1 value2|
value1 := 'abcd'.
value2 := 12345.
dict:=Dictionary new.
dict at: 'subop1' put: value1.
dict at: 'subop2' put: value2.
array:=Array with: dict.
array asJson





so your code should become

self optionAt: 'op1' put (Array with: aDictionary).








On 09/01/2011 10:40 AM, Gastón Dall' Oglio wrote:
> Hello.
>
> I'm writing a new JQWidget component and I need generate js code like
> this for correctly load of the wrapped plugin:
> $("#id").funcname({"op1":[{"subop1":"value1","subop2":"value2",...}],...});
>
>
> I don't know how do it. I have a method JQMyWidget>>subop1:value, where
> I write some [stupid] implementation:
>
> 1) self optionAt: 'op1' put: (Array with: 'subop1' with: value)     =>
>     $("#id").funcname({"op1":["subop1","value"]})
>
> 2) self optionAt: 'op1' put: ('subop1' -> value)     =>
> $("#id").funcname({"op1":'subop1'->'value'})
>
> 3) self optionAt: 'op1' put: (self optionAt: 'subop1' put: value)     =>
>     $("#id").funcname({"op1":"value","subop1":"value"})
>
> Any idea? Thanks in advance.
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list