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

It should be possible to skip some elements on the collection binding #5263

Closed
pjasiun opened this issue Oct 20, 2016 · 4 comments · Fixed by ckeditor/ckeditor5-ui#94
Closed
Labels
package:ui type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@pjasiun
Copy link

pjasiun commented Oct 20, 2016

It would be a nice feature if I could skip some elements on binding collection:

itemsControllerCollection.bind( modelItems ).as( ( modelItem ) => {
    if ( modelItem.hidden ) {
        return null;
    } else {
        const itemView = new ItemView( editor.locale );
        return new Controller( modelItem, itemView );
    }
} );

It should be doable, even with a nice position mapping.

@pjasiun
Copy link
Author

pjasiun commented Nov 9, 2016

During moving collection binding from the CollectionController to the ViewCollection this functionality has been removed.

@pjasiun pjasiun reopened this Nov 9, 2016
@pjasiun
Copy link
Author

pjasiun commented Nov 9, 2016

Of course the sample code now should looks like:

viewCollection.bindTo( modelItems ).as( ( modelItem ) => {
    if ( modelItem.hidden ) {
        return null;
    } else {
        return new ItemView( editor.locale );
    }
} );

@oleq
Copy link
Member

oleq commented Nov 18, 2016

@pjasiun
Copy link
Author

pjasiun commented Feb 7, 2017

pjasiun referenced this issue in ckeditor/ckeditor5-utils Jan 9, 2018
Feature: Introduced skipping items when binding collections. Closes #215. Closes https://github.com/ckeditor/ckeditor5-ui/issues/92.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-ui Oct 9, 2019
@mlewand mlewand added this to the iteration 14 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:improvement This issue reports a possible enhancement of an existing feature. package:ui labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:ui type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants