1 回答
TA贡献1842条经验 获得超12个赞
$('.dt-add').each(function () {
var whichtable = $(this).parents('form').attr('data-id');
$(this).on('click', function(evt){
var rowData = [];
var table = $('#teammembertable' + whichtable).DataTable();
rowData.push('<select class="form-control addstafftype" id="addstafftype" name="addstafftype">'+
'<option value="">Select</option>'+
'<?php foreach($selectallstaff as $staffname){ ?>'+
'<option value="<?php $staffname["Staff_id"]; ?>"><?php $staffname["Staff_name"]; ?></option>'+
'<?php } ?>'+
'</select');
rowData.push('<button type="button" data-id='+ whichtable +' class="btn-xs dt-delete dt-deletes"><i style="font-size:10px" class="fa"></i></button>');
table.row.add(rowData).draw( false );
});
});
- 1 回答
- 0 关注
- 143 浏览
添加回答
举报