Every line of 'jquery datatable edit row data' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
22 function editRow(oTable, nRow) { 23 var aData = oTable.fnGetData(nRow); 24 var jqTds = $('>td', nRow); 25 var record_types = ""; 26 for(var i = 0; i < records_allow_edit.length; i++) { 27 var record_type = records_allow_edit[i]; 28 record_types += ""; 29 } 30 jqTds[0].innerHTML = ''; 31 //jqTds[1].innerHTML = ''; 32 jqTds[1].innerHTML = '' + record_types + ''; 33 jqTds[2].innerHTML = ''; 34 jqTds[3].innerHTML = ''; 35 jqTds[4].innerHTML = ''; 36 jqTds[5].innerHTML = '<a href>Save</a>'; 37 jqTds[6].innerHTML = '<a href>Cancel</a>'; 38 39 // set current value of dropdows column 40 if (aData[2] == 'Active'){ 41 isDiable = 'false'; 42 } 43 else { 44 isDiable = 'true'; 45 } 46 47 SelectElement('record_type', aData[1]); 48 SelectElement('record_status', isDiable); 49 SelectElement('record_ttl', aData[3]); 50 }
173 function editRow(oTable, nRow) { 174 var aData = oTable.fnGetData(nRow); 175 var jqTds = $('>td', nRow); 176 jqTds[0].innerHTML = ''; 177 jqTds[1].innerHTML = ''; 178 jqTds[2].innerHTML = ''; 179 jqTds[3].innerHTML = ''; 180 jqTds[4].innerHTML = '<a href="#"><i></i> Save</a> <a href="#"><i></i> Cancel</a>'; 181 }
34 getRowsForDataTable(data) { 35 return data; 36 }
152 onDataTableRenderCellSelect: function Jobs_onDataTableRenderCellSelect(dataTable, el, oRecord, oColumn, oData) 153 { 154 el.innerHTML = ""; 155 },
10 function get_row($row){ 11 var counter = $row.attr('data-counter'); 12 var row = rows[counter]; 13 if (row){ 14 return row; 15 } 16 var $modal = $row.parent().parent().parent(); 17 row = { 18 counter: counter, 19 $row: $row, 20 $modal: $modal, 21 $submit: $modal.find('button[type="submit"]'), 22 show_msg: function (msg, color){ 23 var $msg = $('<span>').html(msg); 24 if (color){ 25 $msg.css('color', color); 26 } 27 this.$row.find('.message').html('').append($msg); 28 }, 29 block: function(){ 30 this.$row.find('input,select').not('.email').attr('disabled', 1); 31 this.$row.addClass('blocked'); 32 this.$submit.attr('disabled', '1'); 33 }, 34 disable_known_field: function(field){ 35 this.$row.find('[name=' + this.counter + '-' + field + ']').attr('disabled', 1); 36 }, 37 reset: function(){ 38 // remove message and restrictions 39 this.$row.find('input,select').removeAttr('disabled'); 40 this.$row.find('.message').html(''); 41 this.$row.removeClass('blocked'); 42 if (!this.$modal.find('.row.blocked').length){ 43 this.$submit.removeAttr('disabled'); 44 } 45 } 46 }; 47 rows[counter] = row; 48 return row; 49 }</span>
7 function refreshTableRows(table, data) { 8 var tbody = table.find('tbody'); 9 // Clear rows 10 tbody.empty(); 11 12 // Append all rows 13 $.each(data, function () { 14 var row = '<tr>'; 15 16 for (var key in this) { 17 var val = this[key]; 18 row += '<td>' + val + '</td>'; 19 } 20 21 row += '<td>-</td></tr>'; 22 tbody.append(row); 23 }); 24 25 }
25 {"data": function data(row, type, set, meta) { 26 return row["http.status_code"]; 27 }},
186 addRow(row) { 187 this.rows.push(row) 188 }
90 function saveRow(oTable, nRow) { 91 var jqTds = $('> td', nRow); 92 var jqInputs = $('input', nRow); 93 var dataPost = {}; 94 $.each(jqInputs, function(index, val) { 95 var currentValue = jqInputs[index].value || ''; 96 eval('dataPost.args_' + index + ' = "' + currentValue + '"'); 97 }); 98 $.each(options.editableFields, function(index, val) { 99 oTable.fnUpdate($(jqTds[val]).find('input').val(), nRow, val, false); 100 }); 101 102 oTable.fnUpdate('<a>Fast edit</a>', nRow, options.actionPosition, false); 103 104 $.ajax({ 105 url: options.ajaxUrlSaveRow, 106 type: 'POST', 107 dataType: 'json', 108 data: dataPost, 109 beforeSend: function(){ 110 App.blockUI({ 111 message: options.loadingMessage || 'Loading...', 112 target: grid.getTableWrapper(), 113 overlayColor: 'none', 114 cenrerY: true, 115 boxed: true 116 }); 117 }, 118 complete: function(data) { 119 grid.getTableWrapper().find('.blockUI').remove(); 120 if(typeof data.responseJSON != 'undefined') 121 { 122 if(data.responseJSON.error) 123 { 124 Utility.showNotification(data.responseJSON.message, 'danger'); 125 } 126 else 127 { 128 Utility.showNotification(data.responseJSON.message, 'success'); 129 } 130 131 } 132 else 133 { 134 Utility.showNotification('Some error occurred!', 'danger'); 135 } 136 oTable.api().ajax.reload(); 137 } 138 }); 139 }
100 onDataTableRenderCellAction: function onDataTableRenderCellAction(dataTable, el, oRecord, oColumn, oData) { 101 var actions = [], 102 data = oRecord.getData(); 103 // TODO: i18n 104 actions.push('<a href="#"> </a>'); 105 actions.push('<a href="#"> </a>'); 106 el.innerHTML = actions.join(""); 107 },