Download the PHP package nineinchnick/edatatables without Composer
On this page you can find all versions of the php package nineinchnick/edatatables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nineinchnick/edatatables
More information about nineinchnick/edatatables
Files in nineinchnick/edatatables
Package edatatables
Short Description Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin
License BSD-3-Clause
Informations about the package edatatables
Goal of this widget/wrapper is to provide a drop in replacement for base CGridView widget from the Yii framework, using DataTables plugin.
It's usable, but feedback is needed. Please post issues on project's page.
Features
- Redrawing of table contents (after paging/sorting/searching) using AJAX calls;
- Using CGridView columns definition format, supports all basic special columns like Buttons, Checkbox, etc;
- Custom buttons in table header;
- Smoothness theme from JUI by default;
- Twitter Bootstrap support through the bootstrap extension;
- Partial editable cells support.
Requirements
- Yii 1.1.8 or above;
- PHP 5.3;
- (optional) Bootstrap extension.
Usage
It's not 100% compatible with CGridView. I've decided not to alter the GET parameter names used by DataTables, so you have to use the provided EDTSort and EDTPagination classes as well as alter filter processing. See below.
Installation
Extract into extensions dir, or use composer: $ composer require nineinchnick/edatatables:dev-master
Import in config/main.php
Using
Use similar to CGridView. If displayed in a normal call just run the widget. To fetch AJAX response send json encoded result of $widget->getFormattedData().
The action in a controller:
The index view (for non-ajax requests):
Preparing the dataprovider
To use features like sorting, pagination and filtering (by quick search field in the toolbar or a custom advanced search filter form) the dataprovider object passed to the widget must be prepared using provided EDTSort and EDTPagination class and CDbCriteria filled after parsing sent forms.
The simplest example:
An advanced example would be based on a search form defined with a model and a view. Its attributes would be then put into a critieria and passed to a dataProvider.
Other options
Check out the DataTables web page for docs regarding:
- Table layout
- Styling
- Multi-column sorting etc.
- Some examples and funky plugins
Using with Twitter Bootstrap
Since the bootstrap attribute has been removed, please use the following configuration in the widget factory or as a default skin for your bootstrap theme:
Resources
- GitHub: https://github.com/nineinchnick/edatatables
- Composer package named nineinchnick/edatatables
All versions of edatatables with dependencies
mozarcik/yii-datepicker Version 1.4.*
datatables/datatables Version 1.10.*