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

[Sugestion] Option to change the default order of the file uploaded #1179

Closed
11 of 18 tasks
brunonetadmin opened this issue Feb 5, 2018 · 4 comments
Closed
11 of 18 tasks

Comments

@brunonetadmin
Copy link

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of bootstrap-fileinput.
  • This is not an usage question. I confirm having read the plugin documentation and demos.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional).

Steps to reproduce the issue

Add a new file.

Expected behavior and actual behavior

When a new file its added, it goes to the end of the list. I need it stays in the first of the list (more recent first). Something like a option : default_order = "ASC" or "DESC"

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer
  • Safari

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version: 3.3.1
  • bootstrap-fileinput version: latest

Isolating the problem

  • This bug happens on the plugin demos page
  • The bug happens consistently across all tested browsers
  • This bug happens when using bootstrap-fileinput without other plugins
  • I can reproduce this bug in a jsbin
@kartik-v
Copy link
Owner

kartik-v commented Feb 6, 2018

You can control this in your server code.. e.g. the uploadUrl that processes the upload.... because the file stack is passed as an array to your uploadUrl.

You can for example always read the file stack array on your server code in the reverse order (for DESC/ASC)... e.g. PHP provides array_reverse.

Sorting of files on the client that are not yet uploaded is not a trivial programming and will be complex and is hence not added as a functionality - because of the various possibilities that user can do before uploading the file (e.g. cancelling, deleting, OR resizing, OR partially uploading and trying to reupload etc.)

@kartik-v kartik-v closed this as completed Feb 6, 2018
@brunonetadmin
Copy link
Author

This is possible for files that are already uploaded, but i´m talking about the new files we add. It aways start in the end of the "table", in the "explorer" template, i think this is the way you append, instead of set it to the end, a option to add in the first row of the table.

@kartik-v
Copy link
Owner

kartik-v commented Feb 6, 2018

Will look at a possibility to see if I can add an enhancement.

@kartik-v kartik-v reopened this Feb 6, 2018
kartik-v added a commit that referenced this issue Feb 7, 2018
kartik-v added a commit that referenced this issue Feb 7, 2018
@kartik-v
Copy link
Owner

kartik-v commented Feb 7, 2018

New boolean property reversePreviewOrder has been added.

Refer the reverse preview order demo as well.

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

No branches or pull requests

2 participants