<table class="table table-striped table-bordered table-hover" id="items-table">
    <thead>
    <tr style="background-color: #5376B9; color: white">
        <th>STT</th>
        <th>Tên </th>
        <th>Mã tài sản </th>
        <th>Mã tham chiếu</th>
    </tr>
    </thead>
    <tfoot>
    <tr>
        <th></th>
        <th><input type="text" class="form-control"></th>
        <th><input type="text" class="form-control"></th>
        <th><input type="text" class="form-control"></th>
    </tr>
    </tfoot>
</table>
<script>
    var item_table;
    $('#items-table tfoot th').each(function (index) {
        if (index != 0 && index != 3) {
            $(this).html('<input type="text" class="form-control" />');
        }
    });
    item_table = $('#items-table').DataTable({
        "bDestroy": true,
        processing: true,
        searching: true,
        "aaSorting": [],
        serverSide: true,
        ajax: {
            url: '{!! url('admin2/import-export/ie_item.data') !!}',
            data: {
                ie_id: '{{ $ieId }}'
            }
        },
        columns: [

            {data: 'DT_Row_Index', name: 'DT_Row_Index', orderable: false, searchable: false},
            {data: 'name', name: 'name'},
            {data: 'code', name: 'code'},
            {data: 'reference', name: 'reference'},
        ],
    });


    item_table.columns().every(function (index) {
        if (index !== 0) {
            var that = this;
            $('input', this.footer()).on('keyup change', function () {
                if (that.search() !== this.value) {
                    that
                        .search(this.value)
                        .draw();
                }
            });


        }
    });
</script>