javascript - datatable column shifts on confirmation dialog -


i using datatables.net , js slike

 var dt =$('#feedback-data-table').datatable( {         ajax: {             url: hname + "/my rest url",             datasrc: "items"         },         columns: [             {                 "class":          "details-control",                 "orderable":      false,                 "data":           null,                 "defaultcontent": "",                 "width": "5px"             },              {                 "class":          "flag-control cnfrm",                 "orderable":      false,                 "data":           null,                  "defaultcontent": "",                 "width": "5px"             },             { title: "app name", data: "appname" , classname:"word-break-all"},             { title: "error", data: "msgdetails",              "render": function ( data, type, full, meta ) {                   return type === 'display' && data.length > 240 ?                     '<span title="'+data+'">'+data.substr( 0, 238 )+'...</span>' :                     data;                 },             classname:"word-break-all", width:"40%" },              { title: "count", data: "frequency"}         ]     });       var detailrows = [];        $('#feedback-data-table').on( 'click', 'tr td.details-control', function () {         var tr = $(this).closest('tr');         var row = dt.row( tr );         var idx = $.inarray( tr.attr('id'), detailrows );          if ( row.child.isshown() ) {             tr.removeclass( 'details' );             row.child.hide();              // remove 'open' array             detailrows.splice( idx, 1 );         }         else {             tr.addclass( 'details' );             row.child( format( row.data() ) ).show();              // add 'open' array             if ( idx === -1 ) {                 detailrows.push( tr.attr('id') );             }         }     } );      // on each draw, loop on `detailrows` array , show child rows     dt.on( 'draw', function () {         $.each( detailrows, function ( i, id ) {             $('#'+id+' td.details-control').trigger( 'click' );         } );     } )       //flag row         $('#feedback-data-table tbody').on( 'click', 'tr', function () {             if ( $(this).hasclass('selected') ) {                 $(this).removeclass('selected');             }             else {                 dt.$('tr.selected').removeclass('selected');                 $(this).addclass('selected');             }         } );        $('#feedback-data-table').on( 'click', 'tr td.flag-control', function () {         $('.cnfrm').confirmation({     onconfirm: function(event) { alert('confirm') },     oncancel: function(event) { alert('cancel') }         });         }); 

when click on 2nd column having icon delete. whole row shifts right 1 column. column issue happens on click is:

{                 "class":          "flag-control cnfrm",                 "orderable":      false,                 "data":           null,                  "defaultcontent": "",                 "width": "5px"             }, 


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -