简体   繁体   中英

Flexigrid loading data from local json object

I am trying to fill flexigrid table from local created json object, using this code:

var rows = new Array();
rows.push({cell: [1, 2, 3] });
rows.push({cell: [11, 22, 33] });
rows.push({cell: [111, 222, 333] });

var data = {
    total: 3,    
    page:1,
    rows: rows
}

$('table').flexAddData(data);//.flexReload();

but after executing this, it just empties my table.

full and live example can be seen here

Notes: ->I comment the last line which tries to load json object because it empties table. ->In this jsfiddle example I am using link for flexigrid from flexigrid.info website, which in chrome doesn't work, in firefox it works.

I figure it out, in initial creating of flexigrid table, I am missing to pass

dataType : 'json'

working copy can be seen here: http://jsfiddle.net/m93qg/3/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM