Changeset 777 for branches/features/taskProcedureRework/grails-app/views/taskProcedureDetailed/_maintenanceActions.gsp
- Timestamp:
- Feb 4, 2011, 3:16:35 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/features/taskProcedureRework/grails-app/views/taskProcedureDetailed/_maintenanceActions.gsp
r776 r777 1 1 <script type="text/javascript"> 2 var childCount = ${taskProcedureInstance?.maintenanceActions.size()} + 0;2 var ma_childCount = ${taskProcedureInstance?.maintenanceActions.size()} + 0; 3 3 var ma_wrapperId = "ma_wrapper"; 4 4 var ma_cloneId = "maintenanceActionLazyList_clone"; … … 8 8 9 9 10 function addChild(wrapperId, cloneId, lazyList, fields, focusField ){10 function addChild(wrapperId, cloneId, lazyList, fields, focusField, childCount){ 11 11 12 12 var clone = jQuery("#"+cloneId).clone(); … … 19 19 fieldsMap[field].attr('id',htmlId + field) 20 20 .attr('name',htmlId + field); 21 if(field == 'isNew') {22 fieldsMap[field].attr('value', 'true');23 }24 21 }); 25 22 … … 27 24 clone.show(); 28 25 fieldsMap[focusField].focus(); 29 childCount++;30 26 } 31 27 32 28 // Click event on add button. 33 29 jQuery('.add-ma').live('click', function() { 34 addChild(ma_wrapperId, ma_cloneId, ma_lazyList, ma_fields, ma_focusField); 30 addChild(ma_wrapperId, ma_cloneId, ma_lazyList, ma_fields, ma_focusField, ma_childCount); 31 ma_childCount++; 35 32 }); 36 33 … … 55 52 56 53 jQuery(window).load(function() { 57 if(childCount == 0) { 58 addChild(ma_wrapperId, ma_cloneId, ma_lazyList, ma_fields, ma_focusField); 54 if(ma_childCount == 0) { 55 addChild(ma_wrapperId, ma_cloneId, ma_lazyList, ma_fields, ma_focusField, ma_childCount); 56 ma_childCount++; 59 57 } 60 58 });
Note: See TracChangeset
for help on using the changeset viewer.