javascript - Bootstrap-Table loading data -
i got difficulties in bootstrap table data loading:
currently in .js
, defined this:
var data = '[{"id": 0,"name": "item 0","price": "$0"}, {"id": 1,"name": "item 1","price": "$1"},{"id": 2,"name": "item 2","price": "$2"}]';
i used 2 methods of loading data table:
json parse above data
blabla=json.parse(data); $('#table').bootstraptable('load',blabla);
this feature working fine
use data:
var blabla=json.parse(data); $('#table').bootstraptable({ data: blabla });
could enlighten me, why 2nd option couldnt view data table? , how should syntax 2nd option if wrong. thanks!
Comments
Post a Comment