cubes.piws.views.table_views.JtableView¶
-
class
cubes.piws.views.table_views.
JtableView
(*args, **kwargs)[source]¶ Create a table view with DataTables.
-
__init__
(*args, **kwargs)[source]¶ Initialize the JtableView class.
If you want to construct the table manually in your view pass the parent view in the ‘parent_view’ attribute.
Methods
__init__
(*args, **kwargs)Initialize the JtableView class. call
([rql_labels, labels, ajaxcallback, ...])Method that will create a table. cell_call
(row, col, **kwargs)the view is called for a particular result set cell critical
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘CRITICAL’. cw_propval
(propid)return cw property value associated to key debug
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘DEBUG’. error
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘ERROR’. exception
(msg, *args, **kwargs)Convenience method for logging an ERROR with exception information. field
(label, value[, row, show_label, w, ...])read-only field html_headers
()return a list of html headers (eg something to be inserted between info
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘INFO’. is_primary
()last_modified
()return the date/time where this view should be considered as linkable
()return True if the view may be linked in a menu page_title
()returns a title according to the result set - used for the render
([w])called to render a view object for a result set. set_http_cache_headers
()set_request_content_type
()set the content type returned by this view set_stream
([w])tal_render
(template, variables)render a precompiled page template with variables in the given url
()return the url associated with this view. Should not be warning
(msg, *args, **kwargs)Log ‘msg % args’ with severity ‘WARNING’. wdata
(data)simple helper that escapes data and writes into self.w whead
(data)wview
(_View__vid[, rset, _View__fallback_vid])shortcut to self.view method automatically passing self.w as argument Attributes
add_div_section
add_to_breadcrumbs
binary
cache_max_age
category
content_type
div_id
mandatory_params
paginable
templatable
title
-
__module__
= 'cubes.piws.views.table_views'¶
-
__regid__
= 'jtable-table'¶
-
call
(rql_labels=None, labels=None, ajaxcallback=None, csv_export=False, title='', elts_to_sort=None, use_server=True, tooltip_name=None, **kwargs)[source]¶ Method that will create a table.
When left clicking on a row, the row is selected (highlighted) Click again on this row to deselect it.
On the right side of each herder box, you can decide to sort the the row if the option is available.
- Extra parameters will be passed to the ajax callback.
2) Column labels must not contain space ‘ ‘ and they need to be replaced: use the ‘label_cleaner’ function.
3) A special ‘ID’ column must be specified in the ajax callback that contains the row string description.
- All the sortable items must be handle in the ajax callback.
Parameters: rql_labels: string (rql_labels) :
a rql that will be executed to get the columns labels.
labels: list of string (xor rql_labels) :
a rql that will be executed to get the columns labels.
ajaxcallback: @func (mandatory) :
a function that will be called by jtable to create dynamically the data to display: do not forget the decorator @ajaxfunc.
csv_export: bool (optional) :
if True an export button will be available.
title: string (optional, default ‘’) :
the title of the table.
elts_to_sort: list of str (optional) :
the colums label that can be sortable.
use_server: bool (optional, default True) :
if True, use server-side processing.
-
div_id
= 'jtable-table'¶
-
mandatory_params
= ['vid', 'rql_labels', 'ajaxcallback', 'labels', 'title', 'elts_to_sort', 'csv_export', 'use_server']¶
-
paginable
= False¶
-
title
= u'Jtable'¶
-