Question: Angular JS Issue


Angular JS Issue

Answers 1
Added at 2016-12-31 07:12

I want to edit row of data table(which is coming from some rest api call,the data in datatable is populated through angular js).

My Question is I need to add one input field in each row and when I submit then all the data will go and save in the database.So can you guys help me adding input field and when I submit then how to get all the datatable data and make a JSON request. enter image description here Please refer the image and I need to add input field in notes column and when press save button then it should take all the 7 datas in datatable and make a json request.

javascript Code:

vm.dataTableInstance = $('.datatable-basic').DataTable({
data : priorityAttrs,
columns : [
           { data: 'priority', title : 'Priority', width : '10%' },
           { data: 'attrName', title : 'Attribute Name', width: '30%' },
           { data: 'notes', title : 'Notes' },
           { data: null, orderable : false, width:'5%', render : function(data, type, row){
               return '<ul class="icons-list"><li class="delete-user text-danger-600" onclick="angular.element(this).scope().deleteAttribute(this, \''+data.attrName+'\')"><a><i class="icon-trash"></i></a></li></ul>';
Answers to

Angular JS Issue

nr: #1 dodano: 2016-12-31 07:12

You can use Angular-Xeditable for add data tables. please refer this document.

  1. install xeditable

    bower install angular-xeditable

  2. Include angular-xeditable into your project

  1. add "xeditable" to dependencies

    var app = angular.module("app", ["xeditable"]);

Source Show
◀ Wstecz