Hi all,

I tried to put some data into a table. I fetch the data with php to a json
string:

<?php
$conn = pg_connect("dbname=chemie user=postgres password=nurTest");

$result = pg_query("select praeparat, menge, einheit from neuansatz");

echo json_encode(array_values(pg_fetch_all($result)));

?>

This is now the output:

[{"praeparat":"test","menge":"1","einheit":"l"}]

Now I try to parse this code, but I get follow error:

qx.io.remote.RequestQueue[244]: Request qx.io.remote.Request[243] handler
_oncompleted threw an error:  SyntaxError: Unable to parse JSON string

=========
var model = new qx.ui.table.model.Simple();
                
 var req = new qx.io.remote.Request("http://localhost/test/pg.php";,
"GET","text/plain"); 

            req.addListener("completed", function(e) { 
                var content = e.getContent();
                var data = qx.lang.Json.parse(content);
                
                model.setColumns([ "Praeparat", "Menge", "Einheit" ]);
                model.setData(data); 
                
            }); 
            
            
            req.send();
            
            var tabel_neuansatz = new qx.ui.table.Table(model_neuansatz);
======

Any ideas?
Thanks!

-Frede-


--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/JSON-Data-into-table-tp6528848p6528848.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to