Complete ajax.data parameter fiddling example?
Complete ajax.data parameter fiddling example?
First, to filter a large set of data on the server side, I want to initially request just a limited date range; then I want a couple of date pickers which let someone change the date range & send a new Ajax request using arguments from those guys. (I think full server-side processing is overkill for what I want; does that sound right?)
I see snippets here which show ajax.data
examples, but is there a complete example which shows how to hook up a date picker or other UI component & trigger a new request with the updated arguments?
Second, for consistency, I want to use the same date picker that Editor uses when editing dates. Should I use Inline standalone editing for this? How do I get the "Update" button to trigger a reload of the table instead of a real edit?
(I apologize for what are probably bonehead-level questions.)
This question has an accepted answers - jump to answer
Answers
Hi Rusty,
What you propose sounds like the way I would do it myself.
You could use something like:
Then on the server-side use
minDate
andmaxDate
in your WHERE condition.Regarding the use of the same date picker that Editor uses, that isn't something that is directly supported, but it is possible. See this thread for some discussion on that.
Allan
Thanks; that example helped.
I found ajax.reload(), and was able to use that to reload the table when the user changes the date range. This table is also using individual column searching; is the
callback
passed toajax.reload()
the right place to rebuild those option lists, or is there something like the table'sinitComplete
I should use? (The function I set forinitComplete
looks like it only fires the first time the table is loaded, not on subsequent calls toajax.reload()
.)Actually, never mind on that comment; I switched to text inputs, which don't have to be rebuilt after a reload.