equal
deleted
inserted
replaced
39 It is however highly configurable and accepts a wealth of options. |
39 It is however highly configurable and accepts a wealth of options. |
40 """ |
40 """ |
41 __regid__ = 'table' |
41 __regid__ = 'table' |
42 title = _('table') |
42 title = _('table') |
43 finalview = 'final' |
43 finalview = 'final' |
|
44 |
|
45 table_widget_class = TableWidget |
|
46 table_column_class = TableColumn |
44 |
47 |
45 def form_filter(self, divid, displaycols, displayactions, displayfilter, |
48 def form_filter(self, divid, displaycols, displayactions, displayfilter, |
46 paginate, hidden=True): |
49 paginate, hidden=True): |
47 try: |
50 try: |
48 filterform = self._cw.vreg['views'].select( |
51 filterform = self._cw.vreg['views'].select( |
142 self.render_actions(divid, actions) |
145 self.render_actions(divid, actions) |
143 # render table |
146 # render table |
144 if paginate: |
147 if paginate: |
145 self.divid = divid # XXX iirk (see usage in page_navigation_url) |
148 self.divid = divid # XXX iirk (see usage in page_navigation_url) |
146 self.paginate(page_size=page_size, show_all_option=False) |
149 self.paginate(page_size=page_size, show_all_option=False) |
147 table = TableWidget(self) |
150 table = self.table_widget_class(self) |
148 for column in self.get_columns(computed_labels, displaycols, headers, |
151 for column in self.get_columns(computed_labels, displaycols, headers, |
149 subvid, cellvids, cellattrs, mainindex): |
152 subvid, cellvids, cellattrs, mainindex): |
150 table.append_column(column) |
153 table.append_column(column) |
151 table.render(self.w) |
154 table.render(self.w) |
152 self.w(u'</div>\n') |
155 self.w(u'</div>\n') |
193 # compute column header |
196 # compute column header |
194 if headers is not None: |
197 if headers is not None: |
195 label = headers[displaycols.index(colindex)] |
198 label = headers[displaycols.index(colindex)] |
196 if colindex == mainindex and label is not None: |
199 if colindex == mainindex and label is not None: |
197 label += ' (%s)' % self.cw_rset.rowcount |
200 label += ' (%s)' % self.cw_rset.rowcount |
198 column = TableColumn(label, colindex) |
201 column = self.table_column_class(label, colindex) |
199 coltype = self.cw_rset.description[0][colindex] |
202 coltype = self.cw_rset.description[0][colindex] |
200 # compute column cell view (if coltype is None, it's a left outer |
203 # compute column cell view (if coltype is None, it's a left outer |
201 # join, use the default non final subvid) |
204 # join, use the default non final subvid) |
202 if cellvids and colindex in cellvids: |
205 if cellvids and colindex in cellvids: |
203 column.append_renderer(cellvids[colindex], colindex) |
206 column.append_renderer(cellvids[colindex], colindex) |