SearchBuilder server-side multiply requests when removing a rule
SearchBuilder server-side multiply requests when removing a rule
![kamil1](https://secure.gravatar.com/avatar/b99aa9c24a83a1465aea4aba588b8313/?default=https%3A%2F%2Fvanillicon.com%2Fb99aa9c24a83a1465aea4aba588b8313_200.png&rating=g&size=120)
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