ajax.reload() on jQuery slider change

ajax.reload() on jQuery slider change

CapamaniaCapamania Posts: 233Questions: 81Answers: 5
edited February 2016 in Free community support

How can I ajax.reload() my table (editor/serverside) on a jQuery slider change? This is my setup:

This question has an accepted answers - jump to answer

Answers

  • CapamaniaCapamania Posts: 233Questions: 81Answers: 5

    Nobody an idea?

  • allanallan Posts: 64,068Questions: 1Answers: 10,563 Site admin

    Can you not just call the ajax.reload() method in the slide callback? Possibly best to use the stop event or change. rangeSlider.on( 'change', function .... );.

    Allan

  • CapamaniaCapamania Posts: 233Questions: 81Answers: 5
    edited February 2016

    It works when I define the var table; at the very top. :-) The DataTable() instance is after the slider() instance. Then the table.ajax.reload() knows the table variable.

  • allanallan Posts: 64,068Questions: 1Answers: 10,563 Site admin
    Answer ✓

    Use $(...).DataTable() to create a new API instance to an existing table (or it will create a new table if there isn't one that matches the selector already).

    Allan

  • CapamaniaCapamania Posts: 233Questions: 81Answers: 5

    Hi Allan. Yes this was the issue. It's now working like a charm. Many thanks

This discussion has been closed.