PDA

View Full Version : Help with json_encode



Danyer Arias Acosta
5 Apr 2008, 12:57 PM
My problem is as follows me make a query to a database and need postgres through json send those values to the customer and then asignarselo an element Ext for example in this case I wish to assign the value of the first under a xtype: 'text', as it would.

As I said earlier I would like to assign a value of the component under whose name: 'desc'

Here I attach the code:



// page: php
//$valores = Array([0] => Array([rol] => Arquitecto)
[1] => Array([rol] => jefe de proyecto))

$json = json_encode($valores);
$json_encode = '{filas:'.$filas.", iter:{$json}".'}';
die($json_encode);

//---------------page js-------------------
Ext.onReady(function(){
var mod = new Ext.FormPanel({
baseCls: 'x-plain',
labelWidth: 85,
bodyStyle:'padding:5% 5% 0',
defaultType: 'textfield',
items: [{
fieldLabel: 'Fase',
name: 'fase',
id: 'fase',
width:200,
allowBlank:false
},{
xtype: 'textarea',
fieldLabel: 'Descripcion',
name: 'desc',
id : 'desc',
width:200,
height:100
},{
fieldLabel: 'Iteracion',
name: 'itera',
id: 'itera',
width:200,
allowBlank:true


}]

});

}); // onready
//------------------------------------------


Greetings