Topic: Slowness issue with dynamic data in select
hockchuan free asked 6 years ago
hockchuan free answered 6 years ago
new WOW().init(); $(document).ready(function() { $('.mdb-select').material_select(); }); $(document).on("change", "#select1", function () { var $select2 = $("#select2"); $select2.empty(); $select2.append($("<option></option>").attr("value", "").text("Choose one")); for (var i = 0; i < 200; i++) { var ri = Math.floor(Math.random() * 10); $select2.append($("<option>Option " + ri + "</option>").attr("value", ri).text("Option " + ri)); } var $select3 = $("#select3"); $select3.empty(); $select3.append($("<option></option>").attr("value", "").text("Choose one")); for (var i = 0; i < 200; i++) { var ri = Math.floor(Math.random() * 10); $select3.append($("<option>Option " + ri + "</option>").attr("value", ri).text("Option " + ri)); } $('.mdb-select').material_select('destroy'); $('.mdb-select').material_select(); });
Anna Morawska staff commented 6 years ago
Hello, thank you for reporting this. I've tried to recreate this, but it looks like everything works fine, but we are definitely going to have a look at it. Best, AniaFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Anna Morawska staff commented 6 years ago
Hello, could you provide us with more details? What exactly do you want to achieve? Best, Annahockchuan free commented 6 years ago
If you try to select item in select1, it will refresh the list of items in select2 and it is working well. Try to select different items in select1 a few times, you can see that the page is getting slower and slower. I continued to select the items in select1 till the page finally becomes unresponsive.Anna Morawska staff commented 6 years ago
Hello, thank you for reporting this bug, we appreciate this. It's already added to our TODO list, we will fix this ass soon as possible. Best, Ania