Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/uploads/./../js/customer/././.
الملفات الموجودة في هذا الـ Path:
.
..
campaign.js
campaign_statistic.js
compose.js
contact.js
dashboard.js
domain.js
email_account.js
email_template.js
form.js
group.js
inbox.js
label.js
lead_finder.js
list_builder.js
queue.js
sender.js
sent.js
settings.js
ticket.js

مشاهدة ملف: group.js

"use strict";
$('#groups').DataTable({
    processing: true,
    serverSide: true,
    responsive:true,
    ajax:'/group/get',
    columns: [
        { "data": "name" },
        { "data": "contacts" },
        { "data": "status" },
        { "data": "action" },
    ],
    fnInitComplete: function(oSettings, json) {
        $(".show-more").css('overflow', 'hidden').readmore({collapsedHeight: 20,moreLink: '<a href="#">More</a>',lessLink: '<a href="#">Less</a>'});
    }
});


$(function () {
    //Initialize Select2 Elements
    $('.select2').select2({
        ajax: {
            delay: 500,
            url:'/contact/search',
            data: function (params) {
                // Query parameters will be ?search=[term]&page=[page]
                return {
                    search: params.term,
                    page: params.page || 1
                };
            },
            cache: true
        }
    });
});


if (edit) {
    $('#groupForm').validate({
        rules: {
            name: {
                required: true
            }
        },
        messages: {
            name: {required: "Please provide  name"},
        },
        errorElement: 'span',
        errorPlacement: function (error, element) {
            error.addClass('invalid-feedback');
            element.closest('.form-group').append(error);
        },
        highlight: function (element, errorClass, validClass) {
            $(element).addClass('is-invalid');
        },
        unhighlight: function (element, errorClass, validClass) {
            $(element).removeClass('is-invalid');
        }
    });
if(countGroupContactIds < 200) {
    $(function () {
        let preData = groupContactIds;
        var selected = [];
        for (var s in preData) {
            selected.push(preData[s].id);
        }
        $('.select2').select2({
            data: preData,
            ajax: {
                delay: 500,
                url: '/contact/search',
                data: function (params) {
                    // Query parameters will be ?search=[term]&page=[page]
                    return {
                        search: params.term,
                        page: params.page || 1
                    };
                },
                cache: true
            },
        }).val(selected).trigger('change');


    });
}
}else{
    $('#groupForm').validate({
        rules: {
            name: {
                required: true
            }
        },
        messages: {
            name: {required: "Please provide  name"},
        },
        errorElement: 'span',
        errorPlacement: function (error, element) {
            error.addClass('invalid-feedback');
            element.closest('.form-group').append(error);
        },
        highlight: function (element, errorClass, validClass) {
            $(element).addClass('is-invalid');
        },
        unhighlight: function (element, errorClass, validClass) {
            $(element).removeClass('is-invalid');
        }
    });

}