-
Notifications
You must be signed in to change notification settings - Fork 379
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
ko.validation.group no work on objects with observable _destroy #567
Comments
@demitriusbelai This is by design and it's less probable it will change. Can you describe your use case? |
First of all, sorry for my English. Take the Loading and saving data example from Knockout http://jsfiddle.net/rniemeyer/bGsRH/ Modified example: http://jsfiddle.net/bGsRH/696/ knockout foreach bind use unwrapObservable to filter destroyed: // Filter out any entries marked as destroyed
var filteredArray = ko.utils.arrayFilter(unwrappedArray, function(item) {
return options['includeDestroyed'] || item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']);
}); Thanks. |
@demitriusbelai Thanks for taking the time to put all that information here. My oppionion on this is to create some flag around each item, eg. |
@crissdev Its works! I have to add Last question: Why unwrap _destroy would be a problem if knockout already does that? Its works for both case: plain and observable _destroy. |
@demitriusbelai Taking |
@crissdev I explained poorly. O fix don't change this behavior. When _destroy is observable, nothing is vaildated in actual version ( |
Related PR #596 |
When create observableArray and its elements have observable _destroy, ko.validation.group don't validate these elements.
Test: http://jsbin.com/mijiqifudi/1/edit?html,js,output
Fix:
The text was updated successfully, but these errors were encountered: