mirror of https://github.com/apache/cloudstack.git
Multi-edit: refactor form serialization
To support header-level form items, serialize every form within the multi-edit div (not just the main table form). For reusability, make data serialization handled in separate 'getMultiData' function.
This commit is contained in:
parent
7de02b6d5c
commit
04ac28202f
|
|
@ -15,6 +15,10 @@
|
|||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
(function($, cloudStack) {
|
||||
var getMultiData = function($multi) {
|
||||
return cloudStack.serializeForm($multi.find('form'));
|
||||
};
|
||||
|
||||
var _medit = cloudStack.ui.widgets.multiEdit = {
|
||||
/**
|
||||
* Append item to list
|
||||
|
|
@ -790,7 +794,7 @@
|
|||
var addItem = function(itemData) {
|
||||
var data = {};
|
||||
|
||||
$.each(cloudStack.serializeForm($multiForm), function(key, value) {
|
||||
$.each(getMultiData($multi), function(key, value) {
|
||||
if (value != '') {
|
||||
data[key] = value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue