Home | Trees | Indices | Help |
|
---|
|
object --+ | S3DataTable
Class representing a data table
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Static Methods | |||
|
|||
|
|||
|
|||
|
|||
|
Class Variables | |
id_counter = 1
|
Properties | |
Inherited from |
Method Details |
S3DataTable constructor
|
Method to render the dataTable into html @param totalrows: The total rows in the unfiltered query. @param filteredrows: The total rows in the filtered query. @param id: The id of the table these need to be unique if more than one dataTable is to be rendered on the same page. If this is not passed in then a unique id will be generated. Regardless the id is stored in self.id so it can be easily accessed after rendering. @param draw: An unaltered copy of draw sent from the client used by dataTables as a draw count. @param attr: dictionary of attributes which can be passed in |
Return the i18n strings needed by dataTables - called by views/dataTables.html |
Method to render the data into a json object @param totalrows: The total rows in the unfiltered query. @param displayrows: The total rows in the filtered query. @param id: The id of the table for which this ajax call will respond to. @param draw: An unaltered copy of draw sent from the client used by dataTables as a draw count. @param attr: dictionary of attributes which can be passed in dt_action_col: The column where the action buttons will be placed dt_bulk_actions: list of labels for the bulk actions. dt_bulk_col: The column in which the checkboxes will appear, by default it will be the column immediately before the first data item dt_group_totals: The number of record in each group. This will be displayed in parenthesis after the group title. |
Method to extract the configuration data from S3 globals and store them as an attr variable. - used by Survey module @return: dictionary of attributes which can be passed into html() @param attr: dictionary of attributes which can be passed in dt_pageLength : The default number of records that will be shown dt_pagination: Enable pagination dt_pagingType: type of pagination, one of: simple simple_numbers full full_numbers (default) http://datatables.net/reference/option/pagingType dt_searching: Enable or disable filtering of data. dt_group: The colum that is used to group the data dt_ajax_url: The URL to be used for the Ajax call dt_action_col: The column where the action buttons will be placed dt_bulk_actions: list of labels for the bulk actions. dt_bulk_col: The column in which the checkboxes will appear, by default it will be the column immediately before the first data item dt_bulk_selected: A list of selected items dt_actions: dictionary of actions dt_styles: dictionary of styles to be applied to a list of ids for example: {"warning" : [1,3,6,7,9], "alert" : [2,10,13]} |
Calculate the export formats that can be added to the table
|
Configure default action buttons
To Do: DRY with S3CRUD.action_buttons() |
Method to wrap the html for a dataTable in a form, add the export formats and the config details required by dataTables @param html: The html table @param id: The id of the table @param orderby: the sort details see http://datatables.net/reference/option/order @param rfields: The list of resource fields @param attr: dictionary of attributes which can be passed in dt_lengthMenu: The menu options for the number of records to be shown dt_pageLength : The default number of records that will be shown dt_dom : The Datatable DOM initialisation variable, describing the order in which elements are displayed. See http://datatables.net/ref for more details. dt_pagination : Is pagination enabled, dafault 'true' dt_pagingType : How the pagination buttons are displayed dt_searching: Enable or disable filtering of data. dt_ajax_url: The URL to be used for the Ajax call dt_action_col: The column where the action buttons will be placed dt_bulk_actions: list of labels for the bulk actions. dt_bulk_col: The column in which the checkboxes will appear, by default it will be the column immediately before the first data item dt_group: The column(s) that is(are) used to group the data dt_group_totals: The number of record in each group. This will be displayed in parenthesis after the group title. dt_group_titles: The titles to be used for each group. These are a list of lists with the inner list consisting of two values, the repr from the db and the label to display. This can be more than the actual number of groups (giving an empty group). dt_group_space: Insert a space between the group heading and the next group dt_bulk_selected: A list of selected items dt_actions: dictionary of actions dt_styles: dictionary of styles to be applied to a list of ids for example: {"warning" : [1,3,6,7,9], "alert" : [2,10,13]} dt_col_widths: dictionary of columns to apply a width to for example: {1 : 15, 2 : 20} dt_text_maximum_len: The maximum length of text before it is condensed dt_text_condense_len: The length displayed text is condensed down to dt_double_scroll: Render double scroll bars (top+bottom), only available with settings.ui.datatables_responsive=False dt_shrink_groups: If set then the rows within a group will be hidden two types are supported, 'individual' and 'accordion' dt_group_types: The type of indicator for groups that can be 'shrunk' Permitted valies are: 'icon' (the default) 'text' and 'none' dt_base_url: base URL to construct export format URLs, resource default URL without any URL method or query part @global current.response.s3.actions used to get the RowActions |
Method to render the data as an html table. This is of use if an html table is required without the dataTable goodness. However if you want html for a dataTable then use the html() method
|
Method to render the data into a json object @param totalrows: The total rows in the unfiltered query. @param displayrows: The total rows in the filtered query. @param id: The id of the table for which this ajax call will respond to. @param draw: An unaltered copy of draw sent from the client used by dataTables as a draw count. @param flist: The list of fields @param attr: dictionary of attributes which can be passed in dt_action_col: The column where the action buttons will be placed dt_bulk_actions: list of labels for the bulk actions. dt_bulk_col: The column in which the checkboxes will appear, by default it will be the column immediately before the first data item dt_group_totals: The number of record in each group. This will be displayed in parenthesis after the group title. |
Class Variable Details |
id_counter
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Mar 15 08:51:49 2019 | http://epydoc.sourceforge.net |