Last change
on this file since 768 was
762,
checked in by gav, 14 years ago
|
Domain change on TaskProcedure and MaintenanceAction, continue task procedure rework.
|
File size:
1.6 KB
|
Line | |
---|
1 | <script type="text/javascript"> |
---|
2 | var childCount = ${taskProcedureInstance?.maintenanceActions.size()} + 0; |
---|
3 | |
---|
4 | function addChild() { |
---|
5 | var htmlId = "maintenanceAction" + childCount; |
---|
6 | var deleteIcon = "${resource(dir:'images/skin', file:'database_delete.png')}"; |
---|
7 | var templateHtml = "<div id='" + htmlId + "' name='" + htmlId + "'>\n"; |
---|
8 | templateHtml += "<input type='text' id='maintenanceActionLazyList[" + childCount + "].description' name='maintenanceActionLazyList[" + childCount + "].description' />\n"; |
---|
9 | templateHtml += "<span onClick='jQuery(\"#" + htmlId + "\").remove();'><img src='" + deleteIcon + "' /></span>\n"; |
---|
10 | templateHtml += "</div>\n"; |
---|
11 | jQuery("#childList").append(templateHtml); |
---|
12 | childCount++; |
---|
13 | } |
---|
14 | </script> |
---|
15 | |
---|
16 | <div id="childList"> |
---|
17 | <g:each var="ma" in="${taskProcedureInstance.maintenanceActions}" status="i"> |
---|
18 | <div id="maintenanceAction${i}"> |
---|
19 | <g:hiddenField name='maintenanceActionLazyList[${i}].id' value='${ma.id}'/> |
---|
20 | <g:textField name='maintenanceActionLazyList[${i}].description' value='${ma.description}'/> |
---|
21 | <input type="hidden" name='maintenanceActionLazyList[${i}].deleted' id='maintenanceActionLazyList[${i}].deleted' value='false'/> |
---|
22 | <span onClick="jQuery('#maintenanceActionLazyList\\[${i}\\]\\.deleted').val('true'); jQuery('#maintenanceAction${i}').hide()"> |
---|
23 | <img src="${resource(dir:'images/skin', file:'database_delete.png')}" /> |
---|
24 | </span> |
---|
25 | </div> |
---|
26 | </g:each> |
---|
27 | </div> |
---|
28 | <input type="button" value="Add MaintenanceAction" onclick="addChild();" /> |
---|
Note: See
TracBrowser
for help on using the repository browser.