Hi Aparajita,
That's true - I was originally talking about quoting the values, but
there's no reason the same logic couldn't be used on the keys. For
instance, it's sometimes necessary to pass in an event handler as an Ext
config option (for instance, passing a renderer to a grid column
config). In that case, you can't have the handler in quotes.
Our "add" method just has an additional "$inFilter" parameter:
--> Method "add"($self; $inKey; $inValue; $inFilter = "")
Depending on the value of $inFilter, the next line is either:
--> $self{"_rep"} += "\"%s\":%s," % ($inKey; encode($inValue;
$inFilter)) [quoted] or
--> $self{"_rep"} += "%s:%s," % ($inKey; encode($inValue;
$inFilter)) [literal]
When configuring components, we leave off the extra quotes. When sending
data, we use them. Then, when writing out the value, same thing. The
"encode" method's call to "encodeString" passes along $inFilter:
--> return (encodeString($inValue; $inFilter))
"EncodeString" just does one more check:
--> if($inFilter="literal")
return ('$result')
else
return ('"$result"')
end if
Basic, but it does what we need it to.
Best,
- Clayton
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/