bootstrapTableFilter doesn't reload table
Hello,
I have this problem with your plugin: after applying filters with the command "bootstrapTableFilter (' getData ')", the linked table isn't reloaded. Filters are not executed.
I'm using last version of plugin.
The code is this:
$('#filter-bar').bootstrapTableFilter({ filters:[ { field: 'descrizioneComune', // field identifier label: 'descrizione Comune', // filter label type: 'search' // filter type }, { field: 'supTot', // field identifier label: 'Sup. (Kmq)', // filter label type: 'range' // filter type }, ], connectTo: '#comuniGALJson', onSubmit: function() { var data = $('#filter-bar').bootstrapTableFilter('getData'); console.log(data); } });
Thanks in advance, Max
I've found a solution for my issue...
- I've found a bug in "bs-table.js". At line 63 "filter" is not defined, so i've add declaration "var filter;"
- I've configured my custom table in this way:
$( document ).ready(function() { $('#comuniGALJson').bootstrapTable( { queryParams: function(params) { var values = $('#filter-bar').bootstrapTableFilter('getData'); if ( !jQuery.isEmptyObject(values)) { var elabFilter = JSON.stringify(values); return elabFilter; } return params; } } );
$('#filter-bar').bootstrapTableFilter({
filters:[
{
field: 'descrizioneComune',
label: 'descrizione Comune',
type: 'search'
},
{
field: 'supTot',
label: 'Sup. (Kmq)',
type: 'range'
},
],
connectTo: '#comuniGALJson',
onSubmit: function() {
var data = $('#filter-bar').bootstrapTableFilter('getData');
console.log(data);
}
});
});