HTML
xxxxxxxxxx
1
<!-- Start your project here-->
2
<div>
3
<div class="m-5" style="height: 100vh; width:800px;">
4
<div class="row mt-5">
5
<h2>Test Performance mdbSelect (500 Options ...)</h2>
6
</div>
7
<div class="row mt-5">
8
<input type="button" value="Init Select" onclick="initData(500);"/>
9
<p class="ml-5 mt-3">
10
Click once and the performance breaks down and the application needs about 1GB Ram
11
</p>
12
13
</div>
14
<div class="row mt-5">
15
<p>mdb select to fill:</p>
16
</div>
17
<div class="row " style="border: 2px solid red;width:400px;">
18
<select id="mdbSelect" class="mdb-select md-form w-100" searchable="Search here..">
19
</select>
20
<label class="mdb-main-label">Header Select</label>
21
</div>
22
</div>
23
</div>
24
<!-- Start your project here-->
CSS
1
1
JS
xxxxxxxxxx
1
<script>
2
3
function initData(count) {
4
console.log("init start");
5
var selectId = '#mdbSelect';
6
7
$(selectId).material_select('destroy');
8
$(selectId).empty();
9
10
for (var i = 1; i <= count; i++) {
11
var value = 1000000 + i;
12
var optionvalue = "Optionvalue to Display -> " + value;
13
$(selectId).append(new Option(optionvalue, value));
14
};
15
16
$(selectId).material_select();
17
18
console.log("init stop");
19
}
20
21
</script>
22
Console errors: 0