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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -