SearchBuilder server-side multiply requests when removing a rule
SearchBuilder server-side multiply requests when removing a rule
kamil1
Posts: 7Questions: 2Answers: 0
Link to test case: Example video
Debugger code (debug.datatables.net): ahifid
Error messages shown:
Description of problem: SearchBuilder server-side multiply requests when removing a rule and defining a new one, server -side script is custom solution not DataTable.Editor library.
Datatables setup
Vue component with plugins:
import DataTable from "datatables.net-vue3";
import DataTablesCore from "datatables.net-bs5";
import 'datatables.net-select-bs5';
import 'datatables.net-buttons-bs5';
import 'datatables.net-fixedcolumns-bs5'
import 'datatables.net-colreorder-bs5';
import 'datatables.net-searchbuilder-bs5';
import languageEN from 'datatables.net-plugins/i18n/en-GB.mjs';
import languageSK from 'datatables.net-plugins/i18n/sk.mjs';
DataTable.use(DataTablesCore);
SearchBuilder button configuration:
{
extend: 'searchBuilder',
className: 'btn-search-builder',
config: {
depthLimit: 2,
liveSearch: false,
enterSearch: false,
columns: [':not(.col-edit):not(.col-delete)'],
conditions: {
string: {
'starts': null,
'!starts': null,
'ends': null,
'!ends': null
}
}
},
}
Answers
Hi,
this post may be the reason for that:
https://datatables.net/forums/discussion/78023/bug-report-search-builder-search-button-event-fires-multiple-time#latest
and here's the commit to fix it: https://github.com/DataTables/SearchBuilder/commit/d901ed75b2e7f7b001b11b2e5446080e49021f50