Coder Social home page Coder Social logo

virtual-select's People

Contributors

m417z avatar sgrell avatar sqisher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sgrell mgred kscgl

virtual-select's Issues

Demo just doesn't work.

Subj.

Also, it's generally a good idea to have demo hosted somewhere, at least on GitHub Pages, so people don't have to download whole repo to see how it works.

Custom Loading Indicator

If a options.loadingIndicatorElement is present, the element should be used instead of the default loading indicator while making sure that Angular bindings in combination with ng-virtual-select keep working.

Simplify data provider

The data provider currently leaks way too many implementation details. The distinction between items and availableItems is confusing. The load function forces the user to load all options into the memory. get does nothing more than slicing the array which is public anyway, etc.

Maybe it makes sense to merge get, load and filter into one function:

{
  totalItemCount: 0,
  filteredItemCount: 0,
  preload: function() { // optional
    // preload all the necessary data
    // return a promise that gets resolved when done
  },
  get: function(query, offset, length) {
    // perform in-memory filtering or make a backend request
    // update totalItemCount and filteredItemCount accordingly
    // return a promise resolving to the requested subset of data
  },
  displayText: function(item, extended) {}, // optional
  identity: function(item) {}, // optional
}

This way get would become much more versatile, filtering becomes an implementation detail and preloading becomes optional.

However, when get becomes asynchronous, we need to account for the fact that it could take much longer to load new data when scrolling. Maybe show loading indicator elements on the top and bottom of the option list, while the loading is in progress?

Add clear option

Hi,
First of all I appreciate the work You're doing here. It will be nice to have clear button in input like in others select controls.

Delay itemHeight calculation until it is actually needed

Currently it's done in the constructor, which is too early, because most likely not all styles have been loaded at this point. The calculation should be delayed until the value is actually needed. In other words: when the option list gets shown.

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.