定制 nterms/yii2-listjs-widget 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nterms/yii2-listjs-widget

Composer 安装命令:

composer require nterms/yii2-listjs-widget

包简介

List.js widget for Yii2

README 文档

README

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.

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

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

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

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

<ul class="list">
	<li><div class="name">Sunday</div></li>
	<li><div class="name">Monday</div></li>
	<li><div class="name">Tuesday</div></li>
	<li><div class="name">Wednesday</div></li>
	<li><div class="name">Thursday</div></li>
	<li><div class="name">Friday</div></li>
	<li><div class="name">Saturday</div></li>
</ul>

<?= \nterms\listjs\ListJs::end(); ?>

Configurations

Following properties are available for customizing the widget.

  • 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
     ...
     '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

统计信息

  • 总下载量: 246
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固