Summary
=======
Table view rendered using the SlickGrid_ library.
SlickGrid is an advanced JavaScript grid/spreadsheet component.
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.
It is highly configuration and accepts the same wealth of option than
cubicweb.web.view.tableview.RsetTableView.
.. _SlickGrid: https://github.com/mleibman/SlickGrid
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
That's all. The rendered table uses the 'slickgrid' view.
Calling the slidgrid from your views
------------------------------------
The simplest way is to call:
.. sourcecode:: python
self._cw.wview('slickgrid', rset, 'null')
Options can be specified by class attributes:
* `displaycols`, if not `None`, should be a list of rset's columns to be
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
names.
* `cellvids`, if not `None`, should be a dictionary with table column index
as key and a view identifier as value, telling the view that should be
used in the given column.
As well as SlickGrid_ specific option:
* `columns_options`: a dictionary of SlickGrid column options
One can use:
.. sourcecode:: python
class MyRsetGridView(RsetGridView):
__regid__ = 'myslickgrid'
headers = (_('first'), _('second'), _('third'))
cellvids = {0: 'text', 1: 'inline', 2:'outofcontext'}
columns_options = {0: {'sortable': False}}
self._cw.wview('myslickgrid', rset, 'null')
Note that the pagination is not working yet.
Raw data
{
"_id": null,
"home_page": "https://forge.extranet.logilab.fr/cubicweb/cubes/cubicweb-slickgrid",
"name": "cubicweb-slickgrid",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "LOGILAB S.A. (Paris, FRANCE)",
"author_email": "contact@logilab.fr",
"download_url": "https://files.pythonhosted.org/packages/f8/71/1809e0d6b07788d512ae5fff8773805f06c6d2ffcc5a4bca62ae92a0cd30/cubicweb-slickgrid-1.3.1.tar.gz",
"platform": null,
"description": "Summary\n=======\n\nTable view rendered using the SlickGrid_ library.\n\nSlickGrid is an advanced JavaScript grid/spreadsheet component.\n\nThis view accepts any non-empty rset. It uses introspection on the\nresult set to compute column names and the proper way to display the\ncells.\n\nIt is highly configuration and accepts the same wealth of option than\ncubicweb.web.view.tableview.RsetTableView.\n\n.. _SlickGrid: https://github.com/mleibman/SlickGrid\n\nExample\n=======\n\nTo try it at the speed of light\n--------------------------------\n\nOnce your instance is running you can go to::\n\n http://localhost:8080/view?rql=Any L, X WHERE X is CWUser, X login L&vid=slickgrid\n\nThat's all. The rendered table uses the 'slickgrid' view.\n\nCalling the slidgrid from your views\n------------------------------------\n\nThe simplest way is to call:\n\n.. sourcecode:: python\n\n self._cw.wview('slickgrid', rset, 'null')\n\nOptions can be specified by class attributes:\n\n* `displaycols`, if not `None`, should be a list of rset's columns to be\n displayed.\n\n* `headers`, if not `None`, should be a list of headers for the table's\n columns. `None` values in the list will be replaced by computed column\n names.\n\n* `cellvids`, if not `None`, should be a dictionary with table column index\n as key and a view identifier as value, telling the view that should be\n used in the given column.\n\nAs well as SlickGrid_ specific option:\n\n* `columns_options`: a dictionary of SlickGrid column options\n\nOne can use:\n\n.. sourcecode:: python\n\n class MyRsetGridView(RsetGridView):\n __regid__ = 'myslickgrid'\n headers = (_('first'), _('second'), _('third'))\n cellvids = {0: 'text', 1: 'inline', 2:'outofcontext'}\n columns_options = {0: {'sortable': False}}\n\n self._cw.wview('myslickgrid', rset, 'null')\n\nNote that the pagination is not working yet.\n",
"bugtrack_url": null,
"license": "LGPL",
"summary": "Table view rendered using the SlickGrid_ JavaScript library.",
"version": "1.3.1",
"project_urls": {
"Homepage": "https://forge.extranet.logilab.fr/cubicweb/cubes/cubicweb-slickgrid"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f8711809e0d6b07788d512ae5fff8773805f06c6d2ffcc5a4bca62ae92a0cd30",
"md5": "12ed66f86d22435449f94aa32fcf4153",
"sha256": "bfe370e73029c84dd06a31d93e55837bfe68092910705e94eeb2eef38449313e"
},
"downloads": -1,
"filename": "cubicweb-slickgrid-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "12ed66f86d22435449f94aa32fcf4153",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 194631,
"upload_time": "2024-09-19T12:22:40",
"upload_time_iso_8601": "2024-09-19T12:22:40.950826Z",
"url": "https://files.pythonhosted.org/packages/f8/71/1809e0d6b07788d512ae5fff8773805f06c6d2ffcc5a4bca62ae92a0cd30/cubicweb-slickgrid-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-19 12:22:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "cubicweb-slickgrid"
}