Commit 6f5b993b authored by David Stutz's avatar David Stutz

Added example for select all performance.

parent 8d803bd2
...@@ -193,6 +193,15 @@ ...@@ -193,6 +193,15 @@
$('#example41').multiselect({ $('#example41').multiselect({
includeSelectAllOption: true includeSelectAllOption: true
}); });
for (var i = 1; i < 1000; i++) {
$('#example45').append('<option value="' + i + '">Option ' + i + '</option>');
}
$('#example45').multiselect({
includeSelectAllOption: true,
maxHeight: 150
});
}); });
</script> </script>
<p> <p>
...@@ -267,6 +276,14 @@ ...@@ -267,6 +276,14 @@
The 'Select all' option automatically repsonds to the selection of the user. In particular, it responds to the initial state of the select. The 'Select all' option automatically repsonds to the selection of the user. In particular, it responds to the initial state of the select.
</td> </td>
</tr> </tr>
<tr>
<td>
<select id="example45" multiple="multiple"></select>
</td>
<td>
Test the performance of the 'Select all' option with 999 options.
</td>
</tr>
<tr> <tr>
<td> <td>
<select id="example3" multiple="multiple"> <select id="example3" multiple="multiple">
......
...@@ -203,6 +203,15 @@ ...@@ -203,6 +203,15 @@
alert('Dropdown hidden ...'); alert('Dropdown hidden ...');
} }
}); });
for (var i = 1; i < 1000; i++) {
$('#example45').append('<option value="' + i + '">Option ' + i + '</option>');
}
$('#example45').multiselect({
includeSelectAllOption: true,
maxHeight: 150
});
}); });
</script> </script>
<p> <p>
...@@ -277,6 +286,14 @@ ...@@ -277,6 +286,14 @@
The 'Select all' option automatically repsonds to the selection of the user. In particular, it responds to the initial state of the select. The 'Select all' option automatically repsonds to the selection of the user. In particular, it responds to the initial state of the select.
</td> </td>
</tr> </tr>
<tr>
<td>
<select id="example45" multiple="multiple"></select>
</td>
<td>
Test the performance of the 'Select all' option with 999 options.
</td>
</tr>
<tr> <tr>
<td> <td>
<select id="example3" multiple="multiple"> <select id="example3" multiple="multiple">
......
...@@ -346,9 +346,9 @@ ...@@ -346,9 +346,9 @@
if (isSelectAllOption) { if (isSelectAllOption) {
var values = []; var values = [];
// Select the visible checkboxes except the "select-all" and possible divider. // Select the visible checkboxes except the "select-all" and possible divider.
var availableInputs = $('li input[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$ul).filter(':visible'); var availableInputs = $('li input[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$ul).filter(':visible');
for (var i = 0, j = availableInputs.length; i < j; i++) { for (var i = 0, j = availableInputs.length; i < j; i++) {
values.push(availableInputs[i].value); values.push(availableInputs[i].value);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment