jquery-tabledit icon indicating copy to clipboard operation
jquery-tabledit copied to clipboard

No edit or Remove icon button

Open luckyzor opened this issue 6 years ago • 5 comments

head.php :

<link rel="stylesheet" type="text/css" href="./css/style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>        
<script src="./plugins/jquery.tabledit.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta charset="utf-8">

the table is OK but no edit or remove icon:

image

jquery code:

<script> $(document).ready(function(){ $('#editable_table').Tabledit({ url:'action.php', hideIdentifier: true, columns:{ identifier:[0, "product_id"], editable:[[6, 'product_stock']] }, restoreButton:false, onSuccess:function(data, textStatus, jqXHR) { if(data.action == 'delete') { $('#'+data.id).remove(); } } }); }); </script>

Can you please help me?

Thanks for your help

luckyzor avatar Sep 12 '18 09:09 luckyzor

hi there, i got the same issue too >.<

ertw0405 avatar Oct 04 '18 02:10 ertw0405

How fix it ?! And i have this problem... Bootstrap 4.1.1

master4eg avatar Oct 06 '18 14:10 master4eg

Hi,

Replace "btn-default" (bootstratp 3) by "btn-secondary" (bootstratp 4) and "glyphicon" by "fa" :

			buttons: {
				edit: {
					class: 'btn btn-sm btn-secondary',
					html: '<span class="fa fa-pencil"></span>',
					action: 'edit'
				},
				delete: {
					class: 'btn btn-sm btn-secondary',
					html: '<span class="fa fa-trash"></span>',
					action: 'delete'
				},

Glyphicons icon font is dropped in bootstrap4, use font-awesome : <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

image

eureka2 avatar Oct 06 '18 15:10 eureka2

btn-default

where to change this?

sumitwaghmare avatar Jun 07 '21 12:06 sumitwaghmare

i had the same issue. you have to change this into tabledit() function section. here is how i did it:

$('#datatable-buttons').on('draw.dt',function(){ $('#datatable-buttons').Tabledit({ url:request_url+'getUpdate', // method:"POST", dataType:'json', columns:{ identifier : [0, 'orders_id'], editable:[[1, 'invoice_number'], [2, 'mobile_number'], [3, 'total_items'] ] // [3, 'gender', '{"1":"Male","2":"Female"}']] },

               buttons: {
                edit: {
                    class: 'btn btn-sm btn-secondary',
                    html: '<span class="fas fa-pencil-alt"></span>',
                    action: 'edit'
                },
                delete: {
                    class: 'btn btn-sm btn-secondary',
                    html: '<span class="fas fa-trash"></span>',
                    action: 'delete'
                }
            },

               restoreButton : false,
               onSuccess : function(data, textStatus, jqXHR){
                   console.log($data);
                if(data.action == 'delete')
                {
                    $('#' + data.id).remove();
                    $('#datatable-buttons').ajax.reload();
                }
            }
        });
    });

some part maybe irrelevant for u, but it will give u an idea where to make changes.

rizwanswati avatar Jul 01 '21 17:07 rizwanswati