multiEdit: Support default value and description

-If 'defaultValue' is specified for a text field, then put that value
 into the text field on load.

-If 'desc' is specified for any field, then use it as a 'title'
 attribute to show a tooltip description.

Example:

      'icmptype': {
        ...
        defaultValue: '-1',
        desc: 'Please specify -1 if you want to allow all'
        ...
      }
This commit is contained in:
Brian Federle 2012-08-13 12:15:35 -07:00
parent a82ff7b0d1
commit f169a97096
1 changed files with 4 additions and 0 deletions

View File

@ -801,6 +801,7 @@
);
if (field.isDisabled) $input.hide();
if (field.defaultValue) $input.val(field.defaultValue);
});
} else {
var $input = $('<input>')
@ -813,6 +814,7 @@
.appendTo($td);
if (field.isDisabled) $input.hide();
if (field.defaultValue) $input.val(field.defaultValue);
}
} else if (field.custom) {
$('<div>').addClass('button add-vm custom-action')
@ -841,6 +843,8 @@
_l(args.add.label)
).appendTo($td);
}
if (field.desc) $input.attr('title', field.desc);
});
// Setup header fields