-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not select filter item after reresh data from ajax #173
Comments
I'm currently running into this scenario. Did you ever find a fix or workaround? I tried re-instantiating the instance, but that didn't help. Below is my implementation: <script>
$(function () {
//Bootstrap Duallistbox
$('.duallistbox').bootstrapDualListbox({
nonSelectedListLabel: 'Available Master Columns',
selectedListLabel: 'Selected Master Columns'
})
var container = $('.bootstrap-duallistbox-container');
container.addClass('d-none');
$('#fetch_columns').on('click', function(e) {
var project = $('#project').val();
var dataset = $('#dataset').val();
var mast_prod = $('#master_product_table').val();
if (project != '' && dataset != '' && mast_prod != ''){
$(this).attr('disabled', true);
$.post(
"{{ url_for('api.system_defaults') }}",
{project: project, dataset: dataset, mast_prod: mast_prod},
function(data){
var select = $('select#required_master_columns.duallistbox');
if(select.prop) {
var options = select.prop('options');
} else {
var options = select.attr('options');
}
$('option', select).remove();
$.each(data, function(index, node) {
options[index] = new Option(node.text, node.id);
});
select.bootstrapDualListbox('refresh', true);
// i've also tried re-instantiating it:
// select.bootstrapDualListbox('destroy');
// $('.duallistbox').bootstrapDualListbox({
// nonSelectedListLabel: 'Available Master Columns',
// selectedListLabel: 'Selected Master Columns'
// })
container.removeClass('d-none');
}
);
}
});
});
</script> @istvan-ujjmeszaros any ideas? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: