Ajax request on preremove

Ajax request on preremove

si08789si08789 Posts: 15Questions: 6Answers: 0

Hi Allan,

I am trying to make an ajax request to delete some folders befores the delete execution but I am unable to get the row data. How can I rescue the row data? I have tried via row.table.field and editor.field('avschool.id').val(); but no neither of them gave me the id variable.

    editor
        .on( 'preRemove', function (data, type, row ) {
            var id = editor.field('table.id').val();

            $.ajax( {
                url: 'process_data.php', 
                data:   {
                    var : id
                },
                type        : 'post'
                }).done(function(data){
               });
        } )

Thank you!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,824Questions: 1Answers: 10,131 Site admin
    Answer ✓

    Are you using the PHP or .NET libraries for Editor? If so, I would suggest using server-side events - specifically the server-side preRemove event in this case.

    Allan

  • si08789si08789 Posts: 15Questions: 6Answers: 0

    Thank you Allan!

    That worked. I could embed the PHP code in the preremove event.

This discussion has been closed.