Skip to content

An event for reach bottom of listview #38

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

Closed
miladhashemi opened this issue Aug 19, 2021 · 8 comments
Closed

An event for reach bottom of listview #38

miladhashemi opened this issue Aug 19, 2021 · 8 comments

Comments

@miladhashemi
Copy link

It's better to have an event when we reach to end of the list.

@miladhashemi miladhashemi changed the title An event for reach bottom of list An event for reach bottom of listview Aug 19, 2021
@andersevenrud
Copy link
Member

andersevenrud commented Aug 19, 2021

I've added the action scroll to the listview where you get an event as the argument. You can use ev.target to calculate any point, not just the bottom.

const el = ev.target
const hitBottom = (el.scrollTop + el.innerHeight) >= el.scrollHeight

@mahsashadi
Copy link

mahsashadi commented Aug 24, 2021

Hi.

We are considering extending the FileManager Application, to support gradual fetching of data by scrolling down.

The VFS adapter should support readdir with limitation. For example in readdir function of our server-side VFS adapter we should consider two limit (number of returned items) and marker (the last item previously returned) parameters.

Since some Adapters may support this feature and some not, what is the best suggestion to add this feature in FileManager Application?

@andersevenrud
Copy link
Member

The best solution for this is to create an interface in the VFS that can be used in options so that all adapters that supports this feature will use the same arguments when using the API.

@mahsashadi
Copy link

By interface in the VFS, you mean we should develop another VFS service-provider that expose readdirLimited method, in addition to other methods like readdir, readfile, ....?

@andersevenrud
Copy link
Member

I mean into the VFS API:

// usage
vfs.readdir('mount:/path', {
  // new interface
  page: {
    size: Number,
    token: String
  }
})

// adapter
function readdir(path, options) {
  fetch('http://localhost', {
    body: JSON.stringify({
      limit: options.page.size,
      marker: options.page.token
    })
  })
}

@mahsashadi
Copy link

Is this client-side options accessibile in server-side VFS adapter?

Whatever I add in options client-side in file-manager, server-side VFS adapter options only contains session object.

@andersevenrud
Copy link
Member

All options are passed along to the server-side adapter. But it actually looks like the readdir in the default system adapter explicitly sets options to {} (which is not right).

@andersevenrud
Copy link
Member

Also, this is off-topic now. Start a new issue please :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants