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

filter_formatter don't hide with filter hide #250

Closed
cspeerly opened this issue Feb 28, 2013 · 4 comments
Closed

filter_formatter don't hide with filter hide #250

cspeerly opened this issue Feb 28, 2013 · 4 comments

Comments

@cspeerly
Copy link

The filter_formatter functions don't hide using filter_hideFilters:true
The baxic Filters and select hide but not the formatter filters.

here is the jsfiddle example http://jsfiddle.net/cspeerly/zbg2r/

Also I had to change this in the formatter css file to enlarge the text on the slider flags
From 0.5em to 1em

/**** Sliders ****/
/* shrink the ui sliders to look nicer inside of a table cell */
.ui-slider {
    width: 90%;
    margin: 12px auto 2px auto; /* add enough top margin so the tooltips will fit */
    font-size: 1em;
}

I also added this so the range slider will resize if the column is resizable

.range {
    width: 90%;
    margin: 12px auto 2px auto; /* add enough top margin so the tooltips will fit */
    font-size: 1em;
}
@Mottie
Copy link
Owner

Mottie commented Feb 28, 2013

Hi cspeerly!

Thanks for reporting this issue! I'll look into making the other form elements cooperate and hide better!

And honestly, the css stuff is a personal thing that users can modify for themselves. I set it to what looks good to me with full knowledge that others will have different preferences and think what I set up as fugly. It's all good! Anyway, this time I think I will compromise with you and change it to 0.8em ;P

@cspeerly
Copy link
Author

cspeerly commented Mar 7, 2013

Thank's so much, looking good
I am trying to mock your example but I can't get the spinner and date thing to work.
example at jsfiffle http://jsfiddle.net/cspeerly/zbg2r/
I like to have the date format of yy/mm/dd. I can get that set to work with dateFormat: but still no work.

@Mottie
Copy link
Owner

Mottie commented Mar 7, 2013

Hiya!

Here is an updated demo

It looks like the spinner wasn't working because the header filter option was set to true:

headers: {
    5: {
        sorter: true,
        filter: true,
        resizable: true
    }
}

The filter option should not be set when using the filter formatter because setting it to true was making the widget think that there was a select there instead of a spinner.

The uiDatePicker filterFormatter function only needed the dateFormat option added and set. Also, the from and to dates needed to match that format:

filter_formatter: {
    6: function ($cell, indx) {
        return $.tablesorter.filterFormatter.uiDatepicker($cell, indx, {
            from: '13/1/1', // default from date
            to: '14/12/31', // default to date
            changeMonth: true,
            changeYear: true,
            dateFormat:'yy/mm/dd' // this is a jQuery DatePicker option
        });
    }
}

Lastly, defining a colgroup with specific col widths (in px) was preventing the resizable widget from resizing the columns; it's only set up to work with percentage widths. So I completely removed the colgroup to demonstrate the difference.

I hope that fixes all of the issues that you were having :)

@cspeerly
Copy link
Author

Thank you very much,.
All is working when I hard code.
I am still having a little problems when I put in int my php pages set from a config.
The filter stays open until I click on reset filters. Then it hides.
The sliders don't always work correctly to the contents in the fields.
It must be in my php code as if I hard code it in it is fine. Although when I browse the source it looks the same.

Thanks, I will work it out on this end
Chuck

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