Level 14
can you try filters: @json($data['filters'])
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.min.js" integrity="sha512-ykZ1QQr0Jy/4ZkvKuqWn4iF3lqPZyij9iRv6sGqLRdTPkY69YX6+7wvVGmsdBbiIfN/8OdsI7HABjvEok6ZopQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/interact.js/1.10.27/interact.min.js" integrity="sha512-U7pxMz47PpFp2XkN2CrzPoILVGEwb6dN0o0/gcz6wserNSwnprr4YoVd5QHHWHVVSA+5gCxeh0yZDVy28T91nQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css" integrity="sha512-WWc9iSr5tHo+AliwUnAQN1RfGK9AnpiOFbmboA0A0VJeooe69YR2rLgHw13KxF1bOSLmke+SNnLWxmZd8RTESQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js" integrity="sha512-Y+0b10RbVUTf3Mi0EgJue0FoheNzentTMMIE2OreNbqnUPNbQj8zmjK3fs5D2WhQeGWIem2G2UkKjAL/bJ/UXQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Files included before js script
var $b = $('#builder');
var optionsQueryBuilder = {
allow_empty: true,
plugins: {
'bt-tooltip-errors': { delay: 100 },
'sortable': null,
'unique-filter': null,
'bt-checkbox': { color: 'primary' },
'invert': null,
'not-group': null
},
// standard operators in custom optgroups
operators: [
{ type: 'equal', optgroup: 'basic' },
{ type: 'not_equal', optgroup: 'basic' },
{ type: 'in', optgroup: 'basic' },
{ type: 'not_in', optgroup: 'basic' },
{ type: 'less', optgroup: 'numbers' },
{ type: 'less_or_equal', optgroup: 'numbers' },
{ type: 'greater', optgroup: 'numbers' },
{ type: 'greater_or_equal', optgroup: 'numbers' },
{ type: 'between', optgroup: 'numbers' },
{ type: 'not_between', optgroup: 'numbers' },
{ type: 'begins_with', optgroup: 'strings' },
{ type: 'not_begins_with', optgroup: 'strings' },
{ type: 'contains', optgroup: 'strings' },
{ type: 'not_contains', optgroup: 'strings' },
{ type: 'ends_with', optgroup: 'strings' },
{ type: 'not_ends_with', optgroup: 'strings' },
{ type: 'is_empty' },
{ type: 'is_not_empty' },
{ type: 'is_null' },
{ type: 'is_not_null' }
],
filters: {!! $data['filters'] !!}
};
$('#querybuilder').queryBuilder(optionsQueryBuilder);
</script>
@endpush
for filters object I am passing this json -
[{"id":"cn_sla","field":"cn_sla","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_number","field":"cn_number","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_tasktype","field":"cn_tasktype","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_priority","field":"cn_priority","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_state","field":"cn_state","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_assignmentgroup","field":"cn_assignmentgroup","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_assignedto","field":"cn_assignedto","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_starttime","field":"cn_starttime","type":"datetime","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":"datepicker"},{"id":"cn_stoptime","field":"cn_stoptime","type":"datetime","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":"datepicker"},{"id":"cn_hasbreached","field":"cn_hasbreached","type":"string","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":""},{"id":"cn_resolved","field":"cn_resolved","type":"datetime","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":"datepicker"},{"id":"cn_closed","field":"cn_closed","type":"datetime","default_value":"","validation":{"allow_empty_value":true},"unique":true,"plugin":"datepicker"}]
In which I want to open datepicker on datetime fields but when I select datetime column from dropdown following js error occurs -
Uncaught TypeError: n[i.plugin] is not a function
Please suggest how to overcome with this issue?
Please or to participate in this conversation.