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

chosen / multi_select / external filter conflict for chosen width option #47

Closed
louking opened this issue May 12, 2014 · 6 comments
Closed
Labels

Comments

@louking
Copy link
Contributor

louking commented May 12, 2014

When I configure a column using external filter and chosen, thus

                {
                    column_number:nameCol,
                    filter_container_id:"_rrwebapp_filtername",
                    filter_type:"multi_select",
                    select_type: 'chosen',
                    select_type_options: {
                        width: 30,
                    },
                    filter_reset_button_text: 'all',
                }

the width parameter to chosen is ignored.

I think the offending code is

args[i].select_type_options = $.extend({}, {width: $(filter_selector_string).closest("th").width() + "px"}, args[i].select_type_options);

which expects the filter to be in the header.

Side issue -- attempt to disable filter_reset_button_text (=false) left reset button with "false" text, rather than disabling the button.

@vedmack
Copy link
Owner

vedmack commented May 12, 2014

I will check what can be done with the width issue, and regarding the false of the reset: make sure youset a boolean false and not a string "false" value because I use ===

@louking
Copy link
Contributor Author

louking commented May 12, 2014

yes, I had checked I'd set a boolean when this occurred

thank you for looking into these -- I could hack something together for a
pull, but would need a better understanding of the unintended side-effects

On Mon, May 12, 2014 at 1:37 PM, Daniel [email protected] wrote:

I will check what can be done with the width issue, and regarding the
false of the reset: make sure youset a boolean false and not a string
"false" value because I use ===


Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-42863088
.

@vedmack
Copy link
Owner

vedmack commented May 12, 2014

Please post the relevant code

@louking
Copy link
Contributor Author

louking commented May 12, 2014

There was a bug in my code -- I was using 30[px] rather than 30em. This value does seem to be taking precedence.

I think there is still a bug in this code for case of external filter, when width is not already set.

Perhaps in the case of external filter, the column's th needs to be looked at to determine the width, rather than closest th. Maybe this works for external or column header filters. Setting width for external case is a workaround to having the width set automatically. But since it is a multi_select, this might be a natural thing to do, to make room for several chosen tags.

So this bug, if it exists, does not affect me, as I'm setting the width myself as a workaround.

I would try to fix and do pull but my code doesn't use column header filters, so I have no easy way to test it for column header filters. I hesitate to just make some code and ask you to test.

@vedmack
Copy link
Owner

vedmack commented May 12, 2014

I will look at it when I'll have the time and you are right, I was never into testing others code, prefer to write my own (don't mind accepting tested one) :)

@vedmack
Copy link
Owner

vedmack commented May 15, 2014

fixed in 0.7.0 version

@vedmack vedmack closed this as completed May 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants