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

Blank multi-select #1369

Closed
JasperH8g opened this issue Oct 23, 2012 · 22 comments
Closed

Blank multi-select #1369

JasperH8g opened this issue Oct 23, 2012 · 22 comments
Milestone

Comments

@JasperH8g
Copy link

I've got a basic has-many-through association:

project.rb:

    has_many :project_assets, :dependent => :delete_all, :autosave => true, :include => :asset
    has_many :assets, :through => :project_assets
    attr_accessible :asset_ids

project_asset.rb:

    belongs_to :asset
    belongs_to :project

asset.rb:

    has_many :project_assets, :dependent => :delete_all
    has_many :projects, :through => :project_assets

I can add new assets through this successfully, but the left part of the multi-select remains blank, so I can't select assets that are already in the model. What could be the reason for this?

@mshibuya
Copy link
Member

This is expected behavior when you have many assets(more than 100 by default).
You need to fill search box above the left pane, and matching assets will be shown in the left pane, retrieved via Ajax request.

@JasperH8g
Copy link
Author

Thanks for your answer. I think though, that there should be some indication for the user that this is the case, and it's not plain broken in some way.

@mshibuya
Copy link
Member

Agreed. That'll be less confusing.

@mshibuya mshibuya reopened this Oct 25, 2012
@douglascamata
Copy link

@mshibuya how is this issue's status? Is there a way to force an initially populate in the field?

@JasperH8g
Copy link
Author

Ha! Just experienced the exact same problem and found this thread again. Is there any progress on this issue? I'd like to do it myself, but I'm not sure when I'll find the time.

@noverloop
Copy link

This is a usability issue, can there be some sort of warning on the admin panel that they have to use the search instead, spent a few hours debugging a non-issue.

it also affects rails_admin has_and_belongs_to_many relationships.

@ghost
Copy link

ghost commented Jan 5, 2015

Spent 2 hours trying to figure out why my associations weren't showing up. They were defined correctly, it was just this issue.

@redterror
Copy link

Just wanted to pile on here - I'd really like to avoid explaining to my users that this isn't really a bug. :)

@daybreaker
Copy link

Throw one more on the pile of people who just spent way too long on this "issue" when all we need is a simple note somewhere around the search box. We have customer service reps who will be using this, and they probably wont remember the required functionality if they infrequently access that part of the edit form.

@mshibuya
Copy link
Member

How do you think the note should be read? I couldn't come up with a concise phrase...

@JasperH8g
Copy link
Author

What actually needs to be done is some automatic paging inside the list and xhr-based searching.

I'm not familiar with the RailsAdmin-codebase, so maybe someone who is can tell us if there already is some infrastructure in place to do something like this?

On 17 Apr 2015, at 05:36, Mitsuhiro Shibuya [email protected] wrote:

How does the note should be read? I couldn't come up with a concise phrase...


Reply to this email directly or view it on GitHub.

@zenkalia
Copy link

zenkalia commented May 7, 2015

Personally I would really like it if the multi select box was disabled and the body said something like "Too many objects, use search box above." (Maybe just "Use search box above." so it fits on one line.)

And if you type a query in and there are no results it would stay disabled and read "No objects found."

@asdffly77
Copy link

It took me a while to find this post. I encountered the same issue.

@mshibuya mshibuya added this to the 0.7 milestone Jun 19, 2015
@mshibuya
Copy link
Member

Added note as described above, thanks @zenkalia !

@JasperH8g
Copy link
Author

Excellent news! 👍

@zenkalia
Copy link

❤️

@SuperMasterBlasterLaser
Copy link
Contributor

@mshibuya This problem still exists. How to help users to understand that he needs to type on input field?

@mshibuya
Copy link
Member

What version are you on?
Can you reproduce that in brand-new app?

@modreoci
Copy link

Hmm... I'we got exactly the same problem like
zenkalia commented on 8 May 2015
snimka obrazovky 2016-07-26 10-55-49
There are many records matched search criteria.
Here is part of my Gemfile.lock:

    rails_admin (0.8.1)
      builder (~> 3.1)
      coffee-rails (~> 4.0)
      font-awesome-rails (>= 3.0, < 5)
      haml (~> 4.0)
      jquery-rails (>= 3.0, < 5)
      jquery-ui-rails (~> 5.0)
      kaminari (~> 0.14)
      nested_form (~> 0.3)
      rack-pjax (~> 0.7)
      rails (~> 4.0)
      remotipart (~> 1.0)
      safe_yaml (~> 1.0)
      sass-rails (>= 4.0, < 6)
    rails_admin-i18n (1.10.2)
    rails_admin_nestable (0.3.2)
      coffee-rails
      haml-rails
      rails_admin (>= 0.6.6)
      sass-rails

What now?

@amicming
Copy link

amicming commented Dec 5, 2016

@modreoci, I reproduced also with Rails 4.2.7.1 and rails_admin 0.8.1

@modreoci
Copy link

modreoci commented Dec 5, 2016

@amicming have you got any solution? Because here is about half a year no response... :-(

@michel-victor
Copy link

Hi @mshibuya. I have the same problem but with the filtering-select. When I have more than 100 items it doesn't load anything. It works with associated_collection_cache_all true but the load is huge. I loved the solution for the multi-select. Could you replicate it in the filtering-select? Thanks for the great job on RailsAdmin.

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