@@ -177,11 +177,33 @@ $('select').selectric({
177
177
*
178
178
* If it's a string, all keys wrapped in brackets will be replaced by
179
179
* the respective values in itemData. Available keys are:
180
- * 'value', 'text', 'slug', 'disabled '.
180
+ * 'value', 'text', 'slug', 'index '.
181
181
*
182
- * If it's a function, it will be called with the following parameters:
183
- * (itemData, element, index). The function must return a string,
184
- * no keys will be replaced in this method.
182
+ * If it's a function, it will be called with the following parameter:
183
+ * (itemData). The function must return a string. If available all keys
184
+ * will be replaced by the respective values in itemData.
185
+ *
186
+ * itemData<Object> {
187
+ * className // Type: String. Description: option class names.
188
+ * disabled // Type: Boolean. Description: option is disabled true/false
189
+ * selected // Type: Boolean. Description: option is selected true/false
190
+ * element // Type: HTMLDomElement. Description: current select element
191
+ * index // Type: Number. Description: current option index
192
+ * slug // Type: String. Description: option slug
193
+ * text // Type: String. Description: option text
194
+ * value // Type: String. Description: option value
195
+ * }
196
+ *
197
+ * EXAMPLE:
198
+ *
199
+ * function(itemData) {
200
+ * return '{text}';
201
+ * }
202
+ *
203
+ * // you're free to build and return your own strings
204
+ * function(itemData) {
205
+ * return itemData.text + '(' + itemData.index + ')';
206
+ * }
185
207
*/
186
208
optionsItemBuilder: ' {text}' ,
187
209
0 commit comments