Rowspan & Colspan in Javascript GridLayout

Mathieu Ducharme ducharme.mathieu at gmail.com
Mon Feb 22 21:58:39 CET 2010


Hi.

I am not sure if this is my script, a documentation issue or a bug in
the js-code itself. Anyway, here's hoping it makes sense...

I am trying to set up a "complex" layout for a plasmoid, using GridLayout[1].

According to [2] it should be possible to specify the rowspan and
colspan as parameters to the addItem method:
gridLayout.addItem(item, row, col, rowspan, colspan);

See attached testcase for an exemple. (plasmate == quick testcase deploy!)

===
mainLayout = new GridLayout(plasmoid);

label1 = new Label();
label1.text = 'Row 1, Col 1';
mainLayout.addItem(label1, 0, 0);

label2 = new Label();
label2.text = 'Row 1, Col 2';
mainLayout.addItem(label2, 0, 1);

label3 = new Label();
label3.text = "Row1, Col 3. \nThis \ncell \nshould \nspan \nacross \n3
\nrows - \nRow1, Col 3. \nThis \ncell \nshould \nspan \nacross \n3
\nrows - \nRow1, Col 3. \nThis \ncell \nshould \nspan \nacross \n3
\nrows";
mainLayout.addItem(label3, 0, 2, 1, 3, 0);

label4 = new Label();
label4.text = "Row 2, Col1. This cell should span across 2 columns -
Row 2, Col1. This cell should span across 2 columns - Row 2, Col1.
This cell should span across 2 columns";
mainLayout.addItem(label4, 1, 0, 2, 0, 0)

label5 = new Label();
label5.text = "Row 3, Col 1";
mainLayout.addItem(label5, 2, 0);

label6 = new Label();
label6.text = "Row 3, Col 2";
mainLayout.addItem(label6, 2, 1);
==

PS. Is there a more comprehensive Javascript API documentation than [3]?

Mathieu

--
[1] If GridLayout fails, how would one embed various layouts to create
equivalent layout?
[2] http://qt.nokia.com/doc/4.6-snapshot/qgraphicsgridlayout.html
[3] http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GridLayout-TestCase.plasmoid
Type: application/octet-stream
Size: 2676 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100222/91582da1/attachment.dll 


More information about the Plasma-devel mailing list