Giter Site home page Giter Site logo

andreypopp / backbone.projections Goto Github PK

View Code? Open in Web Editor NEW
109.0 7.0 9.0 188 KB

backbone.projections is a set of projections for Backbone.Collection

Home Page: http://andreypopp.com/posts/2013-05-15-projections-for-backbone-collections.html

License: MIT License

JavaScript 42.03% PHP 1.81% CoffeeScript 56.15%

backbone.projections's Issues

Add an Optional Offset to Capped Projections

It would be helpful if the capped projection could also take an additional option specifying how far to offset before returning items. This option would of course default to zero if not provided.

As an example, setting "cap" to 5 and not setting "skip" would have a projection that shows indices 0 - 4, inclusive. Setting "cap" to 5 and "skip" to 2 would show indices 2 - 6, inclusive.

It could be "skip", "offset", or whatever makes the most sense.

Thanks again.

Override underlying functions for CRUD

Hello, I'm sorry if this doesn't make sense for this project or I am asking for a stupidity.

In my use case, I have some views that use a FooCollection or a Filtered FooCollection, the views doesn't know if it is filtered or if it is not.

So since my collections are passed around and as I said they don't know if is FooCollection or the filtered one, when I try to add a model to the collection and the collection is the filtered one, the model will be added to the filtered but not in the underlying.

Could be possible to override "add" for example so when you add a model to the filtered it will just pass the message to the underlying?

Or maybe I'm using this project wrong and if so, is it possible to have a filtered collection but actually filtering nothing? So I can change all my CRUD relying in col.underlying.

On the other hand, thanks for "global" versions and thanks for amazing work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.