Commit ddc63c5f authored by Alain Leufroy's avatar Alain Leufroy
Browse files

fix README

parent 1656f2e4a326
Summary
=======
Table view rendered using the SlickGrid_ javascript librairy.
Table view rendered using the SlickGrid_ javascript library.
SlickGrid is an advanced JavaScript grid/spreadsheet component.
This view accepts any non-empty rset. It uses intropection on the
This view accepts any non-empty rset. It uses introspection on the
result set to compute column names and the proper way to display the
cells.
......@@ -14,32 +14,32 @@ cubicweb.web.view.tableview.RsetTableView.
.. _SlickGrid: https://github.com/mleibman/SlickGrid
Exapmple
========
Example
=======
To try it at the speed of light
--------------------------------
Once your instance is running you can go to::
http://localhost:8080/view?rql=Any L, X WHERE X is CWUser, X login L&vid=slickgrid
http://localhost:8080/view?rql=Any L, X WHERE X is CWUser, X login L&vid=slickgrid
That's all. The rendered table uses the 'slickgrid' view.
Calling the slidgrid from your views
------------------------------------
The simplest way is to simply call::
The simplest way is to call:
.. sourcecode:: python
self._cw.wview('slickgrid', rset, 'null')
Although, because it inherite from cubicweb `table` view, options can
Although, because it inherites from cubicweb `table` view, options can
be specified at selection time:
* `displaycols`, if not `None`, should be a list of rset's columns to be
displayed.
displayed.
* `headers`, if not `None`, should be a list of headers for the table's
columns. `None` values in the list will be replaced by computed column
......@@ -49,10 +49,17 @@ be specified at selection time:
as key and a view identifier as value, telling the view that should be
used in the given column.
So one can uses::
As well as SlickGrid_ specific option:
* `columns_options`: a dictionary of SlickGrid column options
One can use:
.. sourcecode:: python
self._cw.wview('slickgrid', rset, 'null',
headers=(_('first'), _('second'), _('third')),
cellvids={0: 'text', 1: 'inline', 2:'outofcontext'})
cellvids={0: 'text', 1: 'inline', 2:'outofcontext'},
columns_options={0: {'sortable': False}})
Note that pagination is not working for now.
Note that the pagination is not working yet.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment