An Angular treeview component with checkbox
This component is currently supporting Bootstrap 4. If you are using Bootstrap 4 alpha 6, please downgrade to the older version 1.0.10.
You can customize CSS yourself to break down dependencies to Bootstrap.
https://leovo2708.github.io/ngx-treeview/
After install the above dependencies, install ngx-treeview
via:
npm install ngx-treeview --save
Once installed you need to import our main module in your application module:
import { TreeviewModule } from 'ngx-treeview';
@NgModule({
declarations: [AppComponent, ...],
imports: [TreeviewModule.forRoot(), ...],
bootstrap: [AppComponent]
})
export class AppModule {
}
<ngx-treeview
[config]="config"
[items]="items"
(selectedChange)="onSelectedChange($event)"
(filterChange)="onFilterChange($event)"
>
</ngx-treeview>
<ngx-dropdown-treeview
[buttonClass]="buttonClass"
[config]="config"
[items]="items"
(selectedChange)="onSelectedChange($event)"
(filterChange)="onFilterChange($event)"
>
</ngx-dropdown-treeview>
config
is optional. This is the default configuration:
{
hasAllCheckBox: true,
hasFilter: false,
hasCollapseExpand: false,
decoupleChildFromParent: false,
maxHeight: 500
}
You can change default configuration easily because TreeviewConfig is injectable.
ngxTreeview
:To map your JSON objects to TreeItem objects.
<ngx-dropdown-treeview
[config]="config"
[items]="items | ngxTreeview:'textField'"
(selectedChange)="onSelectedChange($event)"
>
</ngx-dropdown-treeview>
const itCategory = new TreeviewItem({
text: "IT",
value: 9,
children: [
{
text: "Programming",
value: 91,
children: [
{
text: "Frontend",
value: 911,
children: [
{ text: "Angular 1", value: 9111 },
{ text: "Angular 2", value: 9112 },
{ text: "ReactJS", value: 9113 },
],
},
{
text: "Backend",
value: 912,
children: [
{ text: "C#", value: 9121 },
{ text: "Java", value: 9122 },
{ text: "Python", value: 9123, checked: false },
],
},
],
},
{
text: "Networking",
value: 92,
children: [
{ text: "Internet", value: 921 },
{ text: "Security", value: 922 },
],
},
],
});
You can pass the second paramater 'autoCorrectChecked' with value=true (default is false) in constructor of TreeviewItem to correct checked value of it and all of its descendants. In some cases, you need to push or pop children flexibly, checked of parent may be not correct. Then you need to call function correctChecked() to help to correct from root to its descendants.
const vegetableCategory = new TreeviewItem({
text: "Vegetable",
value: 2,
children: [
{ text: "Salad", value: 21 },
{ text: "Potato", value: 22 },
],
});
vegetableCategory.children.push(
new TreeviewItem({ text: "Mushroom", value: 23, checked: false })
);
vegetableCategory.correctChecked(); // need this to make 'Vegetable' node to change checked value from true to false
Extract data from list of checked TreeviewItem and send it in parameter of event selectedChange. Some built-in TreeviewEventParser:
See example 4 & 5.
I am very appreciate for your ideas, proposals and found bugs which you can leave in github issues. Thanks in advance!
ngx_lua模块 ngx_lua模块的原理: 1、每个worker(工作进程)创建一个Lua VM,worker内所有协程共享VM; 2、将Nginx I/O原语封装后注入 Lua VM,允许Lua代码直接访问; 3、每个外部请求都由一个Lua协程处理,协程之间数据隔离; 4、Lua代码调用I/O操作等异步接口时,会挂起当前协程(并保护上下文数据),而不阻塞worker; 5、I/O等异步操作完
nginx实现了一个红黑树的容器提供使用,定义在ngx_rbtree里面,这个容器相对简单,提供了插入,删除,初始化等方法。 ngx_rbtree.h: //ngx_rbtree_key为unsigned int或者int类型 typedef ngx_uint_t ngx_rbtree_key_t; typedef ngx_int_t ngx_rbtree_key_int_t; type
位置:nginx/src/core/nginx_config.h typedef intptr_t ngx_int_t; typedef uintptr_t ngx_uint_t; intptr_t和uintptr_t在linux平台的/usr/include/stdint.h头文件中可以找到 /* Types for `void *' pointers. */ #if
LuaJIT 安装 下载:http://luajit.org/download/LuaJIT-2.0.4.tar.gz tar -zxvf LuaJIT-2.0.4.tar.gz cd LuaJIT-2.0.4 make make install ngx_devel_kit安装 下载:https://github.com/simpl/ngx_devel_kit/archive/v0.3.0rc1.
第一点:ngx_command_t ngx_core_commands是nginx中的核心模块指令, 它的类型就是ngx_command_t。在每一个module的结构体中,也都有一个ngx_command_t。 typedef struct ngx_command_s ngx_command_t; struct ngx_command_s { ngx_str_t
由于系统准备用frame框架结构,我今天的主要的任务锁搭建调试在frame结构下用treeview进行画面之间的选择跳转。先是在网上找了个javascript的脚本实现的,后来又发现在vs环境下,有插件就可以直接实现的,这样可就可以省去不少写代码的时间了。两者不同之处是一个是在主机实现,一个是在客户端实现的,用javascript写免去了回传的过程,缺点是代码完全暴露于用户眼前了,整个架构也就显而
/* * Copyright (C) Igor Sysoev */ #include <ngx_config.h> #include <ngx_core.h> static u_char *ngx_sprintf_num(u_char *buf, u_char *last, uint64_t ui64, u_char zero, ngx_uint_t hexadecimal,
ngx-weui 是一个使用 Angular 构建的 WeUI 组件。 在线示例以及API文档。
ngx-fastdfs 是 nginx + lua +fastdfs 实现分布式图片实时动态压缩。 install 进入docker目录docker build -t fastdfs:dev . 使用 docker -idt -p 80:80 fastdfs:dev /bin/bash进入容器执行/etc/rc.local 测试 进入容器执行test目录下的./test.sh或者直接执行下面脚本
ngx-markdown ngx-markdown is an Angular library that combines... Marked to parse markdown to HTML Prism.js for language syntax highlight Emoji-Toolkit for emoji support KaTeX for math expression rende
ngx-admin Who uses ngx-admin?| Documentation | Installation Guidelines | Angular templates New! Material theme for ngx-admin Material admin theme is based on the most popular Angular dashboard templat
@sweetalert2/ngx-sweetalert2 Official SweetAlert2 integration for Angular This is not a regular API wrapper for SweetAlert (which already works very well alone), it intends to provide Angular-esque ut
ngx-dropzone A lightweight and highly customizable Angular dropzone component for file uploads. For a demo see DEMO. And the CODE for the demo. Install $ npm install --save ngx-dropzone Usage // in ap
ngx-slick Support angular 6+, Slick 1.8.1 Example Installation To install this library, run: $ npm install ngx-slick --save Consuming your library Once you have published your library to npm, you can
Angular Module for displaying a feed of items in a masonry layout using https://github.com/desandro/masonry This package was originally a fork from https://github.com/jelgblad/angular2-masonry to allo