rice-framework/krad-web/src/main/webapp/krad/scripts/krad.utility.js
/**
 * Enables and disables the save action
 *
 * @param inputField
 * @param highlightItemClass - the class to add to the collection item
 */
Enables and disables the save action

@param inputField
@param highlightItemClass - the class to add to the collection item
Enables and disables the save action @param inputField @param highlightItemClass - the class to add to the collection item
function collectionLineChanged(inputField, highlightItemClass) {
    jQuery(inputField).triggerHandler('change');
    var innerLayout = jQuery(inputField).parents('.' + kradVariables.TABLE_COLLECTION_LAYOUT_CLASS
        + ', .' + kradVariables.STACKED_COLLECTION_LAYOUT_CLASS).first().attr('class');
    if (innerLayout && innerLayout.indexOf(kradVariables.TABLE_COLLECTION_LAYOUT_CLASS) >= 0) {
        var row = jQuery(inputField).closest('tr');
        var enabled = row.find('.dirty').length > 0;
        var saveButton = row.find('.' + kradVariables.SAVE_LINE_ACTION_CLASS);
        if (enabled) {
            saveButton.removeClass('disabled');
            saveButton.removeAttr('disabled');
        } else {
            saveButton.addClass('disabled');
            saveButton.attr('disabled', 'disabled');
        }
    } else {
        var itemGroup = jQuery(inputField).closest('.' + kradVariables.COLLECTION_ITEM_CLASS);
        var enabled = itemGroup.find('.dirty').length > 0;
        var saveButton = itemGroup.find('.' + kradVariables.SAVE_LINE_ACTION_CLASS);
        if (enabled) {
            saveButton.removeClass('disabled');
            saveButton.removeAttr('disabled');
        } else {
            saveButton.addClass('disabled');
            saveButton.attr('disabled', 'disabled');
        }
    }
}
function collectionLineChanged ( inputField , highlightItemClass ) { jQuery ( inputField ) . triggerHandler ( 'change' ) ; var innerLayout = jQuery ( inputField ) . parents ( '.' + kradVariables . TABLE_COLLECTION_LAYOUT_CLASS + ', .' + kradVariables . STACKED_COLLECTION_LAYOUT_CLASS ) . first ( ) . attr ( 'class' ) ; if ( innerLayout && innerLayout . indexOf ( kradVariables . TABLE_COLLECTION_LAYOUT_CLASS ) >= 0 ) { var row = jQuery ( inputField ) . closest ( 'tr' ) ; var enabled = row . find ( '.dirty' ) . length > 0 ; var saveButton = row . find ( '.' + kradVariables . SAVE_LINE_ACTION_CLASS ) ; if ( enabled ) { saveButton . removeClass ( 'disabled' ) ; saveButton . removeAttr ( 'disabled' ) ; } else { saveButton . addClass ( 'disabled' ) ; saveButton . attr ( 'disabled' , 'disabled' ) ; } } else { var itemGroup = jQuery ( inputField ) . closest ( '.' + kradVariables . COLLECTION_ITEM_CLASS ) ; var enabled = itemGroup . find ( '.dirty' ) . length > 0 ; var saveButton = itemGroup . find ( '.' + kradVariables . SAVE_LINE_ACTION_CLASS ) ; if ( enabled ) { saveButton . removeClass ( 'disabled' ) ; saveButton . removeAttr ( 'disabled' ) ; } else { saveButton . addClass ( 'disabled' ) ; saveButton . attr ( 'disabled' , 'disabled' ) ; } } }
Enables and disables the save action
Enables and disables the save action
// This is not very good for performance but because dirty_form gets binded after this event so we need to trigger
 // the dirty_form check before checking for the dirty fields
 // Get the innerlayout to see if we are dealing with table or stack group
