Hide search on datatable that is on an editor form

Hide search on datatable that is on an editor form

crcucbcrcucb Posts: 47Questions: 13Answers: 0

Below is my editor definition which includes a datatable to show residents under an address. Is it possible to hide the search field? you can set I've tried multiple things.

let maintable;
var addresseditor = new DataTable.Editor( {
ajax: 'php/Addresses_Address_DT.php',
table: '#Addresses',
idSrc: "Addresses.AddressAID",
searching: false,
fields: [

        {
            "label": "Address Notes:",
            "name": "Addresses.addressnotes",
            "type": "textarea"
        },
   {
        label: 'Res Pick',
            name: 'FullNameParty',
        type: 'tags',
        limit: 6


    },
    {
            label: 'Residents:',
            name: 'Addresses.AddressAID',
            type: 'datatable',
            dom: 'lrtip', 
            submit: false,
            searching: false,
             paging: false,
            info: false,
            layout: {
                  topStart: null
                    }   ,               
             select:false,


            config: {
                    ajax: {
                        url: 'php/Addresses_Residents_Nested_DT.php',
                        type: 'POST',
                        searching: false,
                        paging: false,
                        info: false,
                        select:false,
                layout: {
                          topStart: null
                        }   ,                                   
                data: function (d) {
                      //if (DataTable.isDataTable('#Addresses')) {
                      // debugger;
                        if (maintable)  { 
                                var selected = maintable.row({ selected: true });
                                if (selected.any()) {

                                    d.AddressAID = selected.data().Addresses.AddressAID;

                                }
                                }
                                //}
                            }

                    },

                    columns: [
                        { title: 'FullName', data: 'FullNameParty' },
                        { title: 'Spoken', data: 'Spoken_With' },
                        { title: 'Confident', data: 'Confident' },
                        { title: 'J FU', data: 'Jordan_Followup' },
                        { title: 'Notes', data: 'ResidentNotes' },
                        { title: 'Ignore', data: 'Ignore' },
                        { title: 'Gender', data: 'Gender' },
                        { title: 'DOB', data: 'Gender' },
                        { title: 'Phone', data: 'Phone' },
                        { title: 'Email', data: 'email' }

                    ]
            } }






    ]


     // fields: [
}



 );

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,756Questions: 1Answers: 10,716 Site admin

    Add searching: false into your config object for the DataTable. See searching.

    Allan

  • crcucbcrcucb Posts: 47Questions: 13Answers: 0

    I already have that in the code above and attaching a screenshot with it circled.
    To clarify, the main datatable has searching enabled. The datatable that is opened beneath the editor is where i want to hide searching and I tried adding searching: false to a few places

  • allanallan Posts: 64,756Questions: 1Answers: 10,716 Site admin
    Answer ✓

    Put it inside the config object, at the same level as ajax and layout in the above screenshot.

    Allan

  • crcucbcrcucb Posts: 47Questions: 13Answers: 0

    Thank you

Sign In or Register to comment.