1 | <img src="http://tinper.org/assets/images/kero.png" width="120" style="max-width:100%;"/>
|
2 |
|
3 |
|
4 | [![npm version](https://img.shields.io/npm/v/kero.svg)](https://www.npmjs.com/package/kero)
|
5 | [![Build Status](https://img.shields.io/travis/iuap-design/kero/master.svg)](https://travis-ci.org/iuap-design/kero)
|
6 | [![devDependency Status](https://img.shields.io/david/dev/iuap-design/kero.svg)](https://david-dm.org/iuap-design/kero#info=devDependencies)
|
7 | [![NPM downloads](http://img.shields.io/npm/dm/kero.svg?style=flat)](https://npmjs.org/package/kero)
|
8 |
|
9 |
|
10 | [中文文档](./README_CN.md)
|
11 | ## Introduction
|
12 | [kero](http://tinper.org/dist/kero/index.html) is a front-end model framework,As a ` MVVM ` architecture ` Model ` layer, multidimensional data Model, provide the solution for complex enterprise applications business application scenario development problems。
|
13 |
|
14 |
|
15 | ## Features
|
16 |
|
17 |
|
18 | ### Abundant API
|
19 |
|
20 |
|
21 |
|
22 | ### Multidimensional Data Model
|
23 |
|
24 |
|
25 | ### Status identifier
|
26 |
|
27 |
|
28 | ### Paging cache capacity
|
29 |
|
30 |
|
31 | ### event trigger
|
32 |
|
33 |
|
34 | ## Quickstart
|
35 |
|
36 | ### Install
|
37 |
|
38 | - From github
|
39 | ```
|
40 | git clone git@github.com:iuap-design/kero.git
|
41 | ```
|
42 |
|
43 | - npm
|
44 |
|
45 | ```
|
46 | npm install kero
|
47 | ```
|
48 |
|
49 | ### simple example
|
50 |
|
51 | #### definition
|
52 |
|
53 |
|
54 | var myDataTable = new u.DataTable({
|
55 | meta:{
|
56 | field1:{required:true},
|
57 | field2:{}
|
58 | }
|
59 | })
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | #### add data
|
66 |
|
67 |
|
68 | dataTable.setSimpleData([
|
69 | {"id": "001","name": "tom"},
|
70 | {"id": "002","name": "john"}
|
71 | ])
|
72 |
|
73 |
|
74 |
|
75 | #### setValue
|
76 |
|
77 | var row = dataTable.createEmptyRow();
|
78 | row.setValue('id','003')
|
79 |
|
80 |
|
81 | #### update
|
82 |
|
83 | var row = dataTable.getRow(index);
|
84 | row.setValue('name','jerry');
|
85 |
|
86 |
|
87 | #### delete
|
88 |
|
89 | dataTable.removeRow(index);
|
90 |
|
91 | #### get all data
|
92 |
|
93 | var json = dataTable.getSimpleData();
|
94 |
|
95 | #### add event trigger
|
96 |
|
97 | ```
|
98 | dataTable1.on('valueChange',function(event){
|
99 | var field = event.field,
|
100 | rowId = event.rowId,
|
101 | oldValue = event.oldValue,
|
102 | newValue = event.newValue;
|
103 | });
|
104 | ```
|
105 |
|
106 |
|
107 | ## Document
|
108 |
|
109 | [Develop documentation](http://tinper.org/dist/kero/docs/overview.html)
|
110 |
|
111 | [Website](http://tinper.org)
|
112 |
|
113 | ## Contributing
|
114 |
|
115 |
|
116 | ### Feedback
|
117 |
|
118 | If you encounter any problems , submit [issues](https://github.com/iuap-design/kero/issues),or pull request。
|
119 |
|
120 | [PR code](CONTRIBUTING.md)
|
121 |
|
122 | ### Develop
|
123 |
|
124 | Developers can participate in the development of kero, but also can be based on kero two development
|
125 |
|
126 |
|
127 | kero use gulp.js and webpack build the project.
|
128 |
|
129 |
|
130 | clone:
|
131 |
|
132 | ```
|
133 | $ git clone git@github.com:iuap-design/kero.git
|
134 | ```
|
135 |
|
136 | install:
|
137 |
|
138 | ```
|
139 | $ npm install
|
140 | ```
|
141 |
|
142 | build:
|
143 |
|
144 | ```
|
145 | $ npm run product
|
146 | ```
|
147 |
|
148 | ### Website Chat Group
|
149 |
|
150 | 527124070
|
151 |
|
152 | ## Licence 版权
|
153 |
|
154 | [MIT](./LICENSE)
|