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

Widget Scroller + Date Range #1454

Closed
dlivi opened this issue Sep 8, 2017 · 2 comments
Closed

Widget Scroller + Date Range #1454

dlivi opened this issue Sep 8, 2017 · 2 comments

Comments

@dlivi
Copy link

dlivi commented Sep 8, 2017

hello, since I turned on the scroller widget, I can not filter with the daterange field anymore. can you help me?
this is my code:

$(function() {
  $("#t-ordini_fornitore")
    .tablesorter({
      theme: "green",
      dateFormat: "ddmmyyyy",
      headers: { 0: { sorter: "checkbox" }, 7: { sorter: "shortDate" } },
      widgets: ["filter", "resizable", "uitheme", "scroller", "stickyHeaders"],
      widgetOptions: {
        scroller_height: 420,
        scroller_upAfterSort: true,
        scroller_jumpToHeader: true,
        scroller_barWidth: null,

        resizable: true,
        resizable_widths: [
          "3%",
          "3%",
          "14%",
          "10%",
          "3%",
          "20%",
          "15%",
          "6%",
          "8%",
          "14%"
        ],

        filter_saveFilters: true,
        filter_reset: "button.reset",

        filter_formatter: {
          7: function($cell, indx) {
            return $.tablesorter.filterFormatter.uiDatepicker($cell, indx, {
              textFrom: "",
              textTo: "",
              changeMonth: true,
              changeYear: true
            });
          }
        },

        filter_placeholder: {
          search: "", // any default search inputs including the datepicker comparison
          from: "Da Data", // datepicker range "from" placeholder
          to: "A Data" // datepicker range "to" placeholder
        }
      }
    })
    .tablesorterPager({
      container: $("#pager-ordini_fornitore"),
      page: 0,
      size: 10,
      output:
        "Articoli da {startRow} a {endRow} di {totalRows} Articoli in Totale"
    })
    .closest(".tablesorter-scroller")
    .on("change", 'thead input[type="checkbox"]', function() {
      var indx,
        $this = $(this),
        checkboxColumn = parseInt(
          $this.closest("th,td").attr("data-column"),
          0
        ),
        isChecked = this.checked;
      ($cells = $("#t-ordini_fornitore")
        .children("tbody")
        .children("tr")
        .children(":nth-child(" + (checkboxColumn + 1) + ")")
        .find("input")), (len = $cells.length);
      for (indx = 0; indx < len; indx++) {
        $cells.eq(indx)[0].checked = isChecked;
      }
      $("#t-ordini_fornitore").trigger("update");
    });
});

Thank you

@Mottie
Copy link
Owner

Mottie commented Sep 8, 2017

Hi @dlivi!

Sadly the scroller widget isn't completely compatible with a lot of other widgets. Especially when you use extended functionality like custom filter_functions and filter_formatter. I don't have a simple solution right now.

@Mottie
Copy link
Owner

Mottie commented Dec 15, 2017

The scroller is only partially compatible with the filter widget. I've centralized all of the scroller widget issues into #1487. Please follow any progress there.

@Mottie Mottie closed this as completed Dec 15, 2017
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