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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -