Rowspan & Colspan in Javascript GridLayout

Mathieu Ducharme ducharme.mathieu at gmail.com
Tue Feb 23 02:19:01 CET 2010


Hi Wayne,

On Mon, Feb 22, 2010 at 5:48 PM, wayne speir <wspeir at gmail.com> wrote:
> Mathieu,
>
> What is it doing or not doing?
>
> -- Wayne

Thanks for the prompt reply.

Sorry I was not clear. Rowspan and colspan do not seem to be taken
into consideration at all.
I have attached a screenshot of the plasmoid resulting from the code here.

Mathieu


[Moderators: sorry, I compressed the screenshots some more]
>
> On Mon, Feb 22, 2010 at 12:58 PM, Mathieu Ducharme
> <ducharme.mathieu at gmail.com> wrote:
>>
>> 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
>>
>> _______________________________________________
>> Plasma-devel mailing list
>> Plasma-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/plasma-devel
>>
>
>
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gridlayout.jpg
Type: image/jpeg
Size: 20450 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100222/43f1c9bc/attachment-0001.jpg 


More information about the Plasma-devel mailing list