<style>
    .pull-left{
float: left !important;
}
</style>
<table id="myTable" class="table table-striped table-bordered dt-responsive nowrap scrolldown" style="width:100%;">
        <thead>
            <tr>
                <!-- <th style="width : 100px;">#</th> -->
                 <!--<th style="width : 100px;">Sr.No.</th> -->
                <th style="width : 700px;">Description</th>
                <th style="width : 200px;">Action</th>
               
            </tr>
        </thead>
        <tbody>
            <?php 
         $srno = 1;
        foreach($data as $result) {                                     
        ?>
            <tr>
                <!-- <td style="width : 100px;">
                    <input type="checkbox" value="{{$result->Description}}" name="ChkValue[]"
                        class="common_selector ChkValue">
                </td> -->
                 <!--<td style="width : 100px;">{{$srno}}</td> -->
                <td style="width : 700px;"><a href="javascript:void(0);" onclick="getDescValue2('{{$result->Description}}')">{{$result->Description}}</a></td>
                <td style="width : 200px;">
                    <a data-id="{{$result->id}}" href='javascript:void(0);' data-toggle="tooltip" data-placement="top"
                        title="Edit" data-original-title="Edit" class="update"><i
                            class="lnr lnr-pencil mr-2"></i></a>&nbsp;&nbsp;
                    <a data-id="{{$result->id}}" href='javascript:void(0);' data-toggle="tooltip" data-placement="top"
                        title="Delete" data-original-title="Delete" class="delete" id="bootbox-confirm"><i
                            class="lnr lnr-trash text-danger"></i></a>
                </td>
               
            </tr>
            <?php $srno++;}  ?>
        </tbody>
    </table>

<script>
    
$(document).ready(function() {
//     $('#example').DataTable({
//         "pageLength": 200,
//         "paging": false,
//         "ordering": false,
//         "info": false,
//         "dom": '<"myCustomClass"f>rt<"bottom"lp><"clear">'
//     });
//     var table = $('#example').DataTable();
 
// $('div.dataTables_filter input', table.table().container()).focus();
// $('.dataTables_filter').addClass('pull-left');
// $('.dataTables_filter input[type="search"]').css(
//      {'width':'300px','display':'inline-block'}
//   );
    function get_filter(class_name) {
        var filter = [];
        $('.' + class_name + ':checked').each(function() {
            filter.push($(this).val());
        });
        return filter;
    }

    $('.common_selector').click(function() {
            var ChkValue = get_filter('ChkValue');
            var ValueId = $('#ValueId2').val();
            if (ChkValue == null) {
                $('#' + ValueId).val('');
            } else {
                $('#OldValue2').val(ChkValue);
            }
            
    });



});

function getDescValue2(val) {
    var ValueId = $('#ValueId2').val();
    var CurrValue = $('#' + ValueId).val();
    var OldValue = val;
    var ModalValue = $('#ModalValue2').val();

    // Replace '/' with ':' if it starts with RE, LE, or BE
    if (/^(RE|LE|BE)\b/.test(OldValue)) {
        OldValue = OldValue.replace(' /', ':');
    }

    if (CurrValue == "") {
        $('#' + ValueId).val(OldValue);
    } else {
        var ConcatValue = CurrValue + "\n" + OldValue;
        if (/^(RE|LE|BE)\b/.test(ConcatValue)) {
        ConcatValue = ConcatValue.replace(' /', ':');
    }
        $('#' + ValueId).val(ConcatValue);
    }

    $('#modal-report22').modal("hide");
}


</script>