Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate edit and delete column tabledit datatable rowsgroup #147

Open
pacifuentes opened this issue Jan 12, 2021 · 0 comments
Open

duplicate edit and delete column tabledit datatable rowsgroup #147

pacifuentes opened this issue Jan 12, 2021 · 0 comments

Comments

@pacifuentes
Copy link

Hi,
Im using datatable, tabledit and rowsgroup based on this example (https://www.webslesson.info/2020/05/make-editable-datatable-using-jquery-tabledit-plugin-with-php-ajax.html), when i add propertie rowsgroup, datatable add or duplicate the edit and delete column of tabledit.

RowsGroup: <script src="https://cdn.rawgit.com/ashl1/datatables-rowsgroup/v1.0.0/dataTables.rowsGroup.js">

Duplicate2

the code of that, is this:

$(document).ready(function(){

 var dataTable = $('#sample_data').DataTable({
  "processing" : true,
  "serverSide" : true,
  "order" : [],
  columns: [
            {
                title: 'Id',
            },
            {
                name: 'first',
                title: 'Eje',
            },
            {
                name: 'second',
                title: 'Objetivo estrategico',
            },
            {
                title: 'Meta',
            },
            {
                title: 'Actividad',
            },
            {
                title: 'Meta esperada',
            },
        ],
  "ajax" : {
   url:"fetch.php",
   type:"POST"
  },
      rowsGroup: [ 'first:name','second:name' ],
 });

 $('#sample_data').on('draw.dt', function(){
  $('#sample_data').Tabledit({
   url:'action.php',
   dataType:'json',
   columns:{
    identifier : [0, 'id'],
    editable:[[4, 'actividad'], [5, 'meta']]
   },
   restoreButton:false,
   onSuccess:function(data, textStatus, jqXHR)
   {
    if(data.action == 'delete')
    {
     $('#' + data.id).remove();
     $('#sample_data').DataTable().ajax.reload();
    }
   }
  });
 });
}); 

Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant