Ignore:
Timestamp:
Feb 4, 2011, 4:13:30 AM (14 years ago)
Author:
gav
Message:

TaskProcedure javascript improvements, move addChild function to dynamicOneToMany.js

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/features/taskProcedureRework/grails-app/views/taskProcedureDetailed/_maintenanceActions.gsp

    r777 r778  
    66    var ma_fields = ["toBeDeleted", "isNew", "description", "reasoning", "assetSubItem.id", "procedureStepNumber"];
    77    var ma_focusField = "procedureStepNumber";
    8 
    9 
    10     function addChild(wrapperId, cloneId, lazyList, fields, focusField, childCount){
    11 
    12         var clone = jQuery("#"+cloneId).clone();
    13         clone.attr('id', lazyList+childCount);
    14         var htmlId = lazyList+'['+childCount+'].';
    15 
    16         var fieldsMap = {};
    17         jQuery.each(fields, function(index, field) {
    18             fieldsMap[field] = clone.find('[id$="'+field+'"]');
    19             fieldsMap[field].attr('id',htmlId + field)
    20                                         .attr('name',htmlId + field);
    21         });
    22 
    23         jQuery("#"+wrapperId).append(clone);
    24         clone.show();
    25         fieldsMap[focusField].focus();
    26     }
    278
    289    // Click event on add button.
Note: See TracChangeset for help on using the changeset viewer.