[#6574] Add a Labor Budget JS template for adding more budget items

The JS template is generated by Rails for adding a new record
and gets appended to the finance section using
addNewDeliverableFinance() (JS).
This commit is contained in:
Eric Davis
2011-09-15 13:26:33 -07:00
parent a6582c9d01
commit 6bff73db93
6 changed files with 42 additions and 22 deletions
+9
View File
@@ -68,6 +68,15 @@ jQuery(function($) {
}
},
addNewDeliverableFinance = function(financeType) {
var t = $('#labor-budget-template').tmpl({});
var countOfExisting = $("#deliverable-labor tbody tr").size();
var recordLocation = countOfExisting + 1; // increments the Rails [n] placeholder
var newContent = t.html().replace(/\[0\]/g, "[" + recordLocation + "]");
$("<tr>" + newContent + '</tr>').appendTo('#deliverable-labor tbody');
},
toggleSpecificDeliverableFields($('form.deliverable'));
$('select#deliverable_type').change(function() {
File diff suppressed because one or more lines are too long