DaltonPimmel / flexigrid

Automatically exported from code.google.com/p/flexigrid
0 stars 0 forks source link

table rows not rendered #107

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When loading flexigrid with json data, table rows are not rendered instead I 
got blank rows. Please see my json data below:

{"page":"1","total":"3","rows":[{"id":"00000000001","name":"test site 
1","url":"test-site1.com"},{"id":"00000000002","name":"test site 
2","url":"test-site2.com"},{"id":"00000000004","name":"test site 
3","url":"test-site3.com"}]}

I checked with firebug and I found out that there is an error found in 
flexigrid.js. Please see error below:

Uncaught TypeError: Cannot read property '0' of undefined 
flexigrid.js:356

Original issue reported on code.google.com by torino.r...@gmail.com on 22 Feb 2012 at 3:10

GoogleCodeExporter commented 8 years ago
You structure is wrong. It should look something like this:

{"page":"1","total":"3","rows":[{"id":"00000000001","cell":["name":"test site 
1","url":"test-site1.com"]},{"id":"00000000002","cell":["name":"test site 
2","url":"test-site2.com"]},{"id":"00000000004","cell":["name":"test site 
3","url":"test-site3.com"]}]}

As a note, I have not been successful in using column names here. If I was 
using this as my own data it would look like this:

{"page":"1","total":"3","rows":[{"id":"00000000001","cell":["test site 
1","test-site1.com"]},{"id":"00000000002","cell":["test site 
2","test-site2.com"]},{"id":"00000000004","cell":["test site 
3","test-site3.com"]}]}

Original comment by mcneil.p...@gmail.com on 22 Feb 2012 at 8:47

GoogleCodeExporter commented 8 years ago
Thank you for the immediate support. I realized that the structure is wrong
looking at jqgrid examples. I think flexigrid and jqgrid are similar in
some way.

Original comment by torino.r...@gmail.com on 23 Feb 2012 at 1:23

GoogleCodeExporter commented 8 years ago
Please help me, still not rendering data. i am using jquery 1.7.2

this is my JSON format : 

{"page":1,"total":3,"rows":[{"kode_barang":"JCMK","cell":["JCMK","Jam The Cars 
Merah Kecil"]},{"kode_barang":"JCMB","cell":["JCMB","Jam The Cars Merah 
Besar"]},{"kode_barang":"JSKB","cell":["JSKB","Jam Sponge Bob Kuning Besar"]}]} 

this is my Code :

    $(document).ready(function() {
        $(function(){
            function doAction() {}

            $("#grid1").flexigrid({
                url: 'column_right.php',
                dataType: 'json',
                colModel : [
                    {display: 'Kode', name : 'kode_barang', width : 80, sortable : true, align: 'center'},
                    {display: 'Nama Barang', name : 'nama_barang', width : 400, sortable : true, align: 'left'}
                    ],
                buttons : [
                    {name: 'Add', bclass: 'add', onpress : doAction},
                    {separator: true},
                    {name: 'Delete', bclass: 'delete', onpress : doAction},
                    {separator: true}
                    ],
                searchitems : [
                    {display: 'Kode', name : 'kode_barang'},
                    {display: 'Nama Barang', name : 'nama_barang', isdefault: true}
                    ],
                sortname: "kode_barang",
                sortorder: "asc",
                usepager: true,
                title: 'Table Barang',
                useRp: true,
                rp: 15,
                showTableToggleBtn: false,
                width: 700,
                height: 300,
                singleSelect: true
            });

        }) 

        })

        ;

Original comment by gdio...@gmail.com on 12 Apr 2012 at 2:57

GoogleCodeExporter commented 8 years ago
add the setting [method: 'GET']
also, for jquery-1.7.2.js - included jquery.cookie.js

Original comment by erich.cl...@gmail.com on 10 May 2012 at 6:04