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:

  1. json parse above data

    blabla=json.parse(data); $('#table').bootstraptable('load',blabla); 

    this feature working fine

  2. 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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -