Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Properties | Private Member Functions | Static Private Attributes
plone.app.content.browser.tableview.Table Class Reference

List of all members.

Public Member Functions

def __init__
def within_batch_size
def set_checked
def batch
def show_select_all_items
def get_nosort_class
def selectall_url
def selectscreen_url
def selectnone_url
def show_all_url
def selected
def viewname

Public Attributes

 request
 context
 base_url
 view_url
 url
 items
 show_sort_column
 buttons
 default_page_size
 pagesize
 show_all
 pagenumber

Static Public Attributes

tuple render = ViewPageTemplateFile("table.pt")
tuple batching = ViewPageTemplateFile("batching.pt")

Properties

 selectcurrentbatch
 selectall = property(_get_select_all, _set_select_all)

Private Member Functions

def _get_select_currentbatch
def _set_select_currentbatch
def _get_select_all
def _set_select_all

Static Private Attributes

 _selectcurrentbatch = False
 _select_all = False

Detailed Description

The table renders a table with sortable columns etc.

It is meant to be subclassed to provide methods for getting specific table info.

Definition at line 6 of file tableview.py.


Constructor & Destructor Documentation

def plone.app.content.browser.tableview.Table.__init__ (   self,
  request,
  base_url,
  view_url,
  items,
  show_sort_column = False,
  buttons = [],
  pagesize = 20 
)

Definition at line 14 of file tableview.py.

00014 
00015                  buttons=[], pagesize=20):
00016         self.request = request
00017         self.context = None # Need for view pagetemplate
00018 
00019         self.base_url = base_url
00020         self.view_url = view_url
00021         self.url = view_url
00022         self.items = items
00023         self.show_sort_column = show_sort_column
00024         self.buttons = buttons
00025         self.default_page_size = 20
00026         self.pagesize = pagesize
00027         self.show_all = request.get('show_all', '').lower() == 'true'
00028 
00029         selection = request.get('select')
00030         if selection == 'screen':
00031             self.selectcurrentbatch=True
00032         elif selection == 'all':
00033             self.selectall = True
00034 
00035         self.pagenumber =  int(request.get('pagenumber', 1))

Here is the caller graph for this function:


Member Function Documentation

Definition at line 78 of file tableview.py.

00078 
00079     def _get_select_all(self):
00080         return self._select_all

Definition at line 66 of file tableview.py.

00066 
00067     def _get_select_currentbatch(self):
00068         return self._selectcurrentbatch

def plone.app.content.browser.tableview.Table._set_select_all (   self,
  value 
) [private]

Definition at line 81 of file tableview.py.

00081 
00082     def _set_select_all(self, value):
00083         self._select_all = bool(value)
00084         if self._select_all:
00085             self._selectcurrentbatch = True

Definition at line 69 of file tableview.py.

00069 
00070     def _set_select_currentbatch(self, value):
00071         self._selectcurrentbatch = value
00072         if self._selectcurrentbatch and self.show_all or (
00073             len(self.items) <= self.pagesize):
00074             self.selectall = True

Definition at line 49 of file tableview.py.

00049 
00050     def batch(self):
00051         pagesize = self.pagesize
00052         if self.show_all:
00053             pagesize = len(self.items)
00054         b = Batch(self.items,
00055                   pagesize=pagesize,
00056                   pagenumber=self.pagenumber)
00057         map(self.set_checked, b)
00058         return b

Here is the call graph for this function:

Definition at line 92 of file tableview.py.

00092 
00093     def get_nosort_class(self):
00094         """
00095         """
00096         return "nosort"

Definition at line 98 of file tableview.py.

00098 
00099     def selectall_url(self):
00100         return self.selectnone_url+'&select=all'

Here is the call graph for this function:

Definition at line 116 of file tableview.py.

00116 
00117     def selected(self, item):
00118         if self.selectcurrentbatch:
00119             return True
00120         return False

Here is the caller graph for this function:

Definition at line 106 of file tableview.py.

00106 
00107     def selectnone_url(self):
00108         base = self.view_url + '?pagenumber=%s' % (self.pagenumber)
00109         if self.show_all:
00110             base += '&show_all=true'
00111         return base

Here is the caller graph for this function:

Definition at line 102 of file tableview.py.

00102 
00103     def selectscreen_url(self):
00104         return self.selectnone_url+'&select=screen'

Here is the call graph for this function:

Definition at line 40 of file tableview.py.

00040 
00041     def set_checked(self, item):
00042         selected = self.selected(item)
00043         item['checked'] = selected and 'checked' or None
00044         item['table_row_class'] = item.get('table_row_class', '')
00045         if selected:
00046             item['table_row_class'] += ' selected'

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 113 of file tableview.py.

00113 
00114     def show_all_url(self):
00115         return self.view_url + '?show_all=true'

Definition at line 89 of file tableview.py.

00089 
00090     def show_select_all_items(self):
00091         return self.selectcurrentbatch and not self.selectall

Definition at line 122 of file tableview.py.

00122 
00123     def viewname(self):
00124         return self.view_url.split('?')[0].split('/')[-1]

Here is the call graph for this function:

Definition at line 37 of file tableview.py.

00037 
00038     def within_batch_size(self):
00039         return len(self.items) < self.pagesize


Member Data Documentation

Definition at line 64 of file tableview.py.

Definition at line 63 of file tableview.py.

Definition at line 18 of file tableview.py.

tuple plone.app.content.browser.tableview.Table.batching = ViewPageTemplateFile("batching.pt") [static]

Definition at line 60 of file tableview.py.

Definition at line 23 of file tableview.py.

Definition at line 16 of file tableview.py.

Definition at line 24 of file tableview.py.

Definition at line 21 of file tableview.py.

Definition at line 34 of file tableview.py.

Definition at line 25 of file tableview.py.

tuple plone.app.content.browser.tableview.Table.render = ViewPageTemplateFile("table.pt") [static]

Definition at line 59 of file tableview.py.

Definition at line 15 of file tableview.py.

Definition at line 26 of file tableview.py.

Definition at line 22 of file tableview.py.

Definition at line 20 of file tableview.py.

Definition at line 19 of file tableview.py.


Property Documentation

Definition at line 86 of file tableview.py.

Initial value:
property(_get_select_currentbatch,
                                  _set_select_currentbatch)

Definition at line 75 of file tableview.py.


The documentation for this class was generated from the following file: