Load datatable based on datepicker and two urls

Load datatable based on datepicker and two urls

SFFSFF Posts: 9Questions: 2Answers: 0

Hi,

recently I got help how to get data from link , cache and show table https://datatables.net/forums/discussion/68675/load-geojson-data-to-html-table/p1?new=1.

On my web page I have map which fetch data from two links and write geo points, that data is changed based on date range from datepicker and updated, so I tried same approach and added datatable in same datepicker function and adjusted ajax url to use datapicker start and end date.
On load it works fine but when I change dates it shows
http://datatables.net/tn/3

This means I can not reinitialise data. I did try some suggested options but it didn't work, not sure if it because of cache is turned on for me.
Check my example bellow in the link.

Another thing is that I have to load two urls in one table where one url is json and second one is xml. I have that problem resolved for map and points where xml is converted into json and then loaded so I was thinking is there a way to use those to fetch data into table? This what Im talking about is in example bellow where you can see two FEED URLs and two FETCH options that uses those URLs (1st is json and 2nd is xml converted to json) .

My example.
http://live.datatables.net/notahezu/1/edit?html,css,js,console,output

Thank you

Answers

  • SFFSFF Posts: 9Questions: 2Answers: 0

    Just to add, I have found solution for first part to reload data in the table as I added
    "destroy": true,
    Now when I use date picker table is refreshed and works.
    Also was able to remove T and Z from date and time.

    Still how can I load two urls as in my example (one json and second one xml)?
    Or is there a way to somehow take data from already loaded load FEED urls as in my example

    http://live.datatables.net/notahezu/4/edit?html,css,js,console,output

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    You've got destroy inside the ajax, it should be outside. If you want to use a different URL, you can change it with ajax.url(),

    Colin

Sign In or Register to comment.