EloquentStudio / filter.js

Complete solution for client side filtering and rendering using JSON data
http://eloquentstudio.github.io/filter.js
MIT License
665 stars 183 forks source link

Using url not working #173

Closed zkenstein closed 5 years ago

zkenstein commented 5 years ago

Hi all,

I tried using the url as json data but nothing to show, can anyone create a sample how to call JSon from url?

I am using this json https://jsonplaceholder.typicode.com/posts

Thanks

zkenstein commented 5 years ago

I think is not active?

jiren commented 5 years ago

can you send me your example code?

zkenstein commented 5 years ago

Hi @jiren ,

Thanks for reply, I really like your script but I got stuck to using it.

here the example script: https://www.dropbox.com/s/zbx1eov9yi1kfwn/examples.zip?dl=0 I used the pagination.html for test it And I also got the Uncaught TypeError: qFn is not a function error on console.

Really need your help, Thank

jiren commented 5 years ago

You need to change view template and filtering options based on your JSON data fields.

zkenstein commented 5 years ago

Do you mean the file under view directory? Or can you please mention which file exactly? I tried take a look under view directory but can't find to edit the attribute

Thanks

zkenstein commented 5 years ago

You need to change view template and filtering options based on your JSON data fields.

Finally found it the data displayed, but this error Uncaught TypeError: qFn is not a function still appeared, how to solved this?

I add this code:

FJS.setStreaming({
    //data_url: 'data/stream_movies.json',
    data_url: "https://jsonplaceholder.typicode.com/posts,
    stream_after: 1,
    batch_size: 50
  }); 

to make it works, but if the json only have one records, view data looping and present the same data

Thanks,

chabri commented 5 years ago

Hi, is it possible to do something like this:

var services = "myremoteurl.com/json.json";
var FJS = FilterJS(services, '#movies', {

});

Get error: Uncaught TypeError: Cannot read property 'replace' of undefined

Any idea? Thanks!