Last change
on this file since 762 was
762,
checked in by gav, 13 years ago
|
Domain change on TaskProcedure and MaintenanceAction, continue task procedure rework.
|
File size:
1.6 KB
|
Rev | Line | |
---|
[760] | 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"; |
---|
[762] | 8 | templateHtml += "<input type='text' id='maintenanceActionLazyList[" + childCount + "].description' name='maintenanceActionLazyList[" + childCount + "].description' />\n"; |
---|
[761] | 9 | templateHtml += "<span onClick='jQuery(\"#" + htmlId + "\").remove();'><img src='" + deleteIcon + "' /></span>\n"; |
---|
[760] | 10 | templateHtml += "</div>\n"; |
---|
[761] | 11 | jQuery("#childList").append(templateHtml); |
---|
[760] | 12 | childCount++; |
---|
| 13 | } |
---|
| 14 | </script> |
---|
| 15 | |
---|
| 16 | <div id="childList"> |
---|
[762] | 17 | <g:each var="ma" in="${taskProcedureInstance.maintenanceActions}" status="i"> |
---|
[760] | 18 | <div id="maintenanceAction${i}"> |
---|
[762] | 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> |
---|
[760] | 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.