-
Notifications
You must be signed in to change notification settings - Fork 1
/
Readme.txt
160 lines (127 loc) · 5.78 KB
/
Readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
b-finder, javascript/jquery selector for tree structured data
Working example: http://silkleo.ru/fun/b-finder/
Goods:
— Compatible with jQuery;
— Simple to use;
— User defined handlers support.
Requirements:
— HTML;
— CSS;
— JavaScript;
— jQuery 1.6+.
Code example:
<code>
$('.b-finder').finder(
'id_dqd',
{
load : function(ext) {
// your code that loads a data tree array from ajax or other source
// (see array description below)
return yourDataList;
},
click : function(event, int, ext) {
// your additional code for single click
},
dblclick : function(event, call, int, ext) {
// your code for double click with ajax requests and other actions
}
},
{
// your params
}
);
</code>
.finder() method params
param | description
============================================================
id | Number or string ID for current Finder instance
------------------------------------------------------------
handlers | Five user handlers: .load, .show, .hide, .click
| and .dblclick. .load and .dblclick are required
------------------------------------------------------------
params | Object with user params (ids, urls, etc)
============================================================
The list of arguments inside .load() handler
# | value
=======================================================================
1. | An object given in params attribute for .finder() method
-----------------------------------------------------------------------
2. | An object which exists only if finder_async param is true.
| Contains Finder own functions with the following keys:
|
| — done — shows finder after data for it is loaded, gets loaded
| data array as an attribute
=======================================================================
The list of arguments inside .show() handler
# | value
=======================================================================
1. | An object given in params attribute for .finder() method
=======================================================================
The list of arguments inside .hide() handler
# | value
=======================================================================
1. | An object given in params attribute for .finder() method
=======================================================================
The list of arguments inside .click() handler
# | value
=======================================================================
1. | Event object
-----------------------------------------------------------------------
2. | Data object from Finder with the following keys:
|
| — id — clicked row id
| — pid — row parend id
| — name — row name
| — next — next column number (to put content there)
| — expandable — is row expandable or not
-----------------------------------------------------------------------
3. | An object given in params attribute for .finder() method
=======================================================================
The list of arguments inside .dblclick() handler
# | value
=======================================================================
1. | Event object
-----------------------------------------------------------------------
2. | Data object from Finder with the following keys:
|
| — id — clicked row id
| — pid — row parend id
| — name — row name
| — next — next column number (to put content there)
| — action — has two values: approve and cancel
| — expandable — is row expandable or not
-----------------------------------------------------------------------
3. | An object given in params attribute for .finder() method
-----------------------------------------------------------------------
4. | An object contains Finder own functions with the following keys:
|
| — hide — closes Finder
| — done — for successful transaction ending
| — undone — for unsuccessful transaction ending
=======================================================================
Own Finder settings in params object for .finder() method
param | value
=======================================================================
finder_async | True if you want to work with async data loading
| (from ajax)
-----------------------------------------------------------------------
finder_holder | True if you don`t need additional column at the end
-----------------------------------------------------------------------
finder_static | True if you want a static displaying of finder
| (inside of another block)
-----------------------------------------------------------------------
finder_multiple | True if you want multiselect to be on
-----------------------------------------------------------------------
finder_cols | Number of columns per «page» from 2 to 4
-----------------------------------------------------------------------
finder_selected | An array of row ids that should be selected for the
| first Finder opening
-----------------------------------------------------------------------
finder_lang | An object contains texts for Finder`s design
| elements with the following keys:
|
| — hat — Finder`s title at the top
| — hint — hint for users at the bottom
| — search — placeholder for search field
| — selected — title for selection filter button
=======================================================================