Hi, this issue is still unresolved. Nudge, nudge…
I could not find a solution
I now need to populate a simple list and I’m facing the same issue
This is the View definition thats works (from one of your snippet examples)
{
view:"list",
height:600,
template:"#rank#. #title# <div style='padding-left:18px'> Year:#year#, votes:#votes# </div>",
select:true,
data: webix.copy(big_film_set),
type:{
height:62
}
The data is
var big_film_set = [{"id":1,"title":"The Shawshank Redemption","year":"1994","votes":"678,79","rating":"9,2","rank":"1"},{"id":2,"title":"The Godfather","year":"1972","votes":"511,495","rating":"9,2","rank":"2"}]
When I replace the data definition from
data: webix.copy(big_film_set)
to
data: "/myapi/myapp/file
which returns a JSON array of objects
it simply does not work and it complains about parsing the valid JSON returned
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
toObject http://cdn.webix.com/edge/webix.js:988
_onLoad http://cdn.webix.com/edge/webix.js:2435
parse http://cdn.webix.com/edge/webix.js:2395
data_setter http://cdn.webix.com/edge/webix.js:2312
_load_when_ready http://cdn.webix.com/edge/webix.js:2302
result http://cdn.webix.com/edge/webix.js:3221
t http://cdn.webix.com/edge/webix.js:3165
_view http://cdn.webix.com/edge/webix.js:3102
_parse_cells http://cdn.webix.com/edge/webix.js:21242
_parse_cells http://cdn.webix.com/edge/webix.js:21852
result http://cdn.webix.com/edge/webix.js:3221
t http://cdn.webix.com/edge/webix.js:3165
_view http://cdn.webix.com/edge/webix.js:3102
body_setter http://cdn.webix.com/edge/webix.js:7734
_define http://cdn.webix.com/edge/webix.js:4588
_parseSeetingColl http://cdn.webix.com/edge/webix.js:4595
_parseSettings http://cdn.webix.com/edge/webix.js:4608
result http://cdn.webix.com/edge/webix.js:3218
t http://cdn.webix.com/edge/webix.js:3165
_view http://cdn.webix.com/edge/webix.js:3102
_ui_creator http://cdn.webix.com/edge/webix.js:3000
ui http://cdn.webix.com/edge/webix.js:2968
<anonymous> http://localhost:8080/pg13.html:319
I also see
JSON.parse: unexpected character at line 1 column 1 of the JSON data
However, curl and Postman do not report any issue… it all works smoothly.
Curl output FYI
$ curl -X GET -v -H "Content-type: application/json" -u _SYSTEM:SYS http://localhost:8080/myapi/myapp/file | jq
Note: Unnecessary use of -X or --request, GET is already inferred.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
* Server auth using Basic with user '_SYSTEM'
> GET /myapi/myapp/file HTTP/1.1
> Host: localhost:8080
> Authorization: Basic X1NZU1RFTTpTWVM=
> User-Agent: curl/7.64.1
> Accept: */*
> Content-type: application/json
>
< HTTP/1.1 200 OK
< Server: nginx/1.21.3
< Date: Mon, 27 Sep 2021 12:04:17 GMT
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-cache
< Expires: Thu, 29 Oct 1998 17:04:19 GMT
< Pragma: no-cache
<
{ [105 bytes data]
100 94 0 94 0 0 1918 0 --:--:-- --:--:-- --:--:-- 1958
* Connection #0 to host localhost left intact
* Closing connection 0
[
{
"name": "darwin.iso"
},
{
"name": "Data.csv"
},
{
"name": "docker-compose.yml"
},
{
"name": "films.csv"
}
]
Pretty please, suggest what else I should be trying out…
Thank you