Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement and fix for species pre-pop #241

Merged
merged 8 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}


version "6.2-SNAPSHOT"
version "6.3-SPECIES-SNAPSHOT"
group "org.grails.plugins"

apply plugin:"eclipse"
Expand Down
9 changes: 4 additions & 5 deletions grails-app/assets/javascripts/forms-knockout-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,9 +1230,7 @@
'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) {
var dataModelItem = valueAccessor();
var behaviours = dataModelItem.get('behaviour');
for (var i = 0; i < behaviours.length; i++) {
var behaviour = behaviours[i];

behaviours && behaviours.forEach(function(behaviour) {
if (behaviour.type == 'pre_populate') {
var config = behaviour.config;
var dataLoaderContext = dataModelItem.context;
Expand All @@ -1245,6 +1243,8 @@
propTarget.loadData(value);
} else if (_.isFunction(propTarget.load)) {
propTarget.load(value);
} else if (propTarget && propTarget.listParent && _.isFunction(propTarget.listParent["load" + propTarget.listName])) {
propTarget.listParent["load" + propTarget.listName](value);
} else if (ko.isObservable(propTarget)) {
propTarget(value);
} else {
Expand Down Expand Up @@ -1295,8 +1295,7 @@
}); // This is a computed rather than a pureComputed as it has a side effect.
});
}
}

});
}
};

Expand Down
1 change: 1 addition & 0 deletions grails-app/assets/javascripts/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ function orEmptyArray(v) {
var listName = context.listName;
var modelName = context.outputModel.name;

self.listParent = context.parent;
self.listName = listName;
self.addRow = function (data) {
var newItem = self.newItem(data, self.rowCount());
Expand Down
Loading
Loading