You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I upgrade to the latest version 4, before the update everything was working fine. But now when I reload the data dynamically it's not clearing the old data in the UI even if the data is not in the array anymore.
I also tried $("#blocks").select2("val", null); which had no effect.
$("#producers").select2({data: producersList,placeholder: 'please select producer'}).on('change',function(e){varproducerId=$("#producers").select2('val');console.log(blocksList);blocksList.length=0;console.log(blocksList);// array is empty $("#blocks").select2("val",null);blocksList=Blocks.find({producerId: producerId}).map(function(obj){varblockProductionId=obj.productionUnitCode+obj.subCode.toString();return{text: blockProductionId,id: obj._id,fieldStatus:obj.fieldStatus};});console.log(blocksList);// correct data // Updates the block data and sets on change event$("#blocks").select2({data: blocksList,placeholder: mf('pleaseSelectBlock','please select block')});$('#blocks').prop("disabled",false);});
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I upgrade to the latest version 4, before the update everything was working fine. But now when I reload the data dynamically it's not clearing the old data in the UI even if the data is not in the array anymore.
I also tried $("#blocks").select2("val", null); which had no effect.
The text was updated successfully, but these errors were encountered: