Skip to content
This repository
Newer
Older
100644 36 lines (25 sloc) 1.226 kb
04ee4803 »
2008-09-15 first svn add of trunk
1 from Sink import Sink, SinkInfo
306ef68f »
2008-10-17 fix import issues
2 from pyjamas.ui import Grid, FlexTable, HasHorizontalAlignment, Image
04ee4803 »
2008-09-15 first svn add of trunk
3
4 class Tables(Sink):
5 def __init__(self):
6 inner = Grid(10, 5)
7 outer = FlexTable()
8
9 outer.setWidget(0, 0, Image(self.baseURL() + "rembrandt/LaMarcheNocturne.jpg"))
10 outer.getFlexCellFormatter().setColSpan(0, 0, 2)
11 outer.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER)
12
13 outer.setHTML(1, 0, "Look to the right...<br>That's a nested table component ->")
14 outer.setWidget(1, 1, inner)
15 outer.getCellFormatter().setColSpan(1, 1, 2)
16
17 for i in range(10):
18 for j in range(5):
19 inner.setText(i, j, "" + i + "," + j)
20
21 inner.setWidth("100%")
22 outer.setWidth("100%")
23
24 inner.setBorderWidth(1)
25 outer.setBorderWidth(1)
26
27 self.initWidget(outer)
28
29 def onShow(self):
30 pass
31
32 def init():
33 text="The <code>FlexTable</code> widget doubles as a tabular data formatter and a panel. In this example, you'll see that there is an outer table with four cells, two of which contain nested components."
306ef68f »
2008-10-17 fix import issues
34 return SinkInfo("Tables", text, Tables)
35
Something went wrong with that request. Please try again.