2017 © Pedro Peláez
 

yii2-extension yii2-listjs-widget

List.js widget for Yii2

image

nterms/yii2-listjs-widget

List.js widget for Yii2

  • Friday, December 19, 2014
  • by nterms
  • Repository
  • 1 Watchers
  • 1 Stars
  • 202 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

yii2-listjs-widget

List.js widget for Yii2. This widget makes List.js functionality available on any list or table in Yii2 applications. Visit List.js website for more info and examples., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist nterms/yii2-listjs-widget "*"

or add, (*4)

"nterms/yii2-listjs-widget": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

= \nterms\listjs\ListJs::begin([
    'id' => 'days-list',
    'search' => true,
    'sort' => [
        'name' => [
            'label' => Yii::t('app', 'Sort by name'),
        ],
    ],
    'clientOptions' => [
        'valueNames' => ['name'],
    ],
]); ?>



  • Sunday
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
= \nterms\listjs\ListJs::end(); ?>

Configurations

Following properties are available for customizing the widget., (*7)

  • options: HTML attributes for the container element.
  • search: Whether to show the search field.
  • searchOptions: HTML attributes (name-value pairs) for the search input tag.
  • sort: list of name-value pairs for rendering the sorting buttons list. Value being the HTML attributes for the button. Special parameter label is used as the button text, (*8)

    ...
    'sort' => [
     'name' => [
         'class' => 'sort',
         'label' => Yii::t('app', 'Sort by name'),
     ],
    ],
    ...
    
    
  • clientOptions: Options for List.js. Read this for list of options.
  • content: HTML content, preferably a list or table. If the widget is used in content capturing mode this will be ignored.
  • view: Name of the view file to render the content. If the widget is used in content capturing mode or a string is assigned to content property this will be ignored.
  • viewParams: Parameters to be passed to view when it is being rendered. This property is used only when view is rendered to generate the content of the widget.

License

MIT, (*9)

The Versions

19/12 2014

dev-master

9999999-dev https://github.com/nterms/yii2-listjs-widget

List.js widget for Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 widget list listjs