[rkward-devel] [rkward-cvs] SF.net SVN: rkward-code:[4897] trunk/rkward/packages/rkwarddev
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Oct 16 19:30:34 UTC 2014
Hi,
On Thursday 16 October 2014 20:40:56 meik michalke wrote:
> speaking of non-trivial... can you hint me to to some documentation of how
> to get all columns out of one row of the optionset? i find it hard to
> understand from the existing examples, but i get the idea it has to to with
> "for" loops.
yes. The storage inside the optionset is column-based (which is rather
unavoidable, technically). So the typical pattern in js is:
col_a = getList ("set.col_a");
col_b = getList ("set.col_b");
col_c = getList ("set.col_c");
for (var i = 0; i < col_a.length; ++i) {
echo ("coolfun (", col_a[i] + ", " + col_b[i] + "," + col_c[i] + ")\n");
}
> i would like to implement some kind of prototypic helper function in
> rkwarddev. unless it turns out to be impossible ;-)
Well, it should be quite possible to create a JS function that converts from
column-based to row-based representation, given a list of column-names of
interested (which may of not be all columns in the set!). I'll leave that as
an exercise to the reader ;-).
Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20141016/75a97100/attachment.sig>
More information about the Rkward-devel
mailing list