Select and Row Delete Only Usable For Certain Groups

Select and Row Delete Only Usable For Certain Groups

zgoforthzgoforth Posts: 493Questions: 98Answers: 2
edited March 2022 in DataTables 1.10

Hello and happy friday!

So I like the option select and row remove, but I only want certain people to be able to have permission to do so. I have the javascript code down, I check the SharePoint group with a REST call, push the names to an array, get the current users display name, if the array.includes the current user, then I want to allow a row selection and delete as well as update the row (with AJAX calls obviously). Is this possible?

Answers

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948

    You can create Datatabes options in a variable then use that variable as part of the configuration settings. For example:

        var select = {
            style:    'os',
            selector: 'td:not(:last-child)'
        };
    
        $('#example').DataTable({
            select: select
        });
    

    You can use if statements to determine which objects to add to the Datatable.

    Kevin

Sign In or Register to comment.