PDA

View Full Version : GridPanel doesn't fill in IE8



FaridJC
3 Feb 2010, 1:22 PM
Hey, this is my first post in this forum, so I have this gridpanel that fills with data from database and it works just perfect on FF but, in IE8 it loads everything but the data. Please help or at least link me to another thread where I may find solution (sorry about my English, I'm from Venezuela)

Here's my code:


Ext.onReady(function(){


// sample static data for the store
/**
* Custom function used for column renderer
* @param {Object} val
*/
var retorno;
function status(val){

if(val == 06){
retorno = '<span style="color:red;">Pago Vencido</span>';
}else if (val == 02){
retorno = '<span style="color:green;">En caja</span>';
} else if ((val == 00) || (val == 10)){
retorno='<span style="color:blue;">Esperando firma</span>';
}
return retorno;
}
function azul(val){
if (val != null){
return '<span style="color:blue;">'+ val +'</span>';
}
}

function azulF(val){
if (val != null){
return '<span style="color:blue;">'+ Ext.util.Format.date(val,'d/m/Y') +'</span>';
}
}

function vencido(val){
if(status()=='<span style="color:red;">Pago Vencido</span>' ){
return '<span style="color:red;">'+ val +'</span>';
} else if (status()=='<span style="color:green;">En caja</span>'){
return '<span style="color:green;">'+ val +'</span>';
} else {
return '<span style="color:blue;">'+ val +'</span>';
}
}

function tipo(val){
if(val == "CH"){
return '<span style="color:blue;">Cheque</span>';
} else if (val == "ND"){
return '<span style="color:blue;">Nota De Debito</span>';
}
}

function azulM(num){
if (num != null){
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return '<span style="color:blue;" text-align="right">'+(((sign)?'':'-') + '' + num + '.' + cents)+'</span>';
}
}

// create the data store
var store = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: 'pagos_back.php',
method: 'POST'
}),
fields: [
{name: 'FEC_DOCUMENTO'},
{name: 'NRO'},
{name: 'MONTO', type: 'float'},
{name: 'STAT'},
{name: 'FV'},
{name: 'CONCEP'},
{name: 'TIPO'}
]
});

// manually load local data
store.load(
{params:
{ cedrif:Ext.get('cedrif').dom.value}
});

// create the Grid
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'fecha',header: 'Fecha',locked:true, width: 65, sortable: false, dataIndex: 'FEC_DOCUMENTO',renderer:azulF},
{id:'nro',header: 'Nro. Documento', width: 130, sortable: false, dataIndex: 'NRO',renderer:azul},
{header: 'Monto', width: 65, sortable: false, dataIndex: 'MONTO',renderer: azulM},
{header: 'Status', width: 75, sortable: false, dataIndex: 'STAT', renderer:status},
{header: 'Vence', width: 70, sortable: false, dataIndex: 'FV',renderer:vencido},
{header: 'Concepto',id: 'concep', width: 2000, sortable: false, dataIndex: 'CONCEP',renderer:azul},
{id:'tipo',header: 'Pago', width: 50, sortable: false, dataIndex: 'TIPO',renderer:tipo}
],
stripeRows: false,
enableHdMenu :false,
height: 300,
width: 735,
title: 'Reporte de Pagos'
});
// render the grid to the specified div in the page
grid.render('grid');
});


Here's the PHP


include('conexion.php');
$arr = array();
$encoded = array();
$cedrif = $_POST['cedrif'];
$year = intval(date('Y'));
$pyear = ($year-3);
$sql = "xxxxx query xxxxx";
$stid = oci_parse($conn, $sql);
$r = oci_execute($stid);
while($row = oci_fetch_assoc($stid)){
/*foreach ($row as $r){
$row[] = utf8_encode($r);
} */
$arr[]= $row;
//echo $row['CONCEP'];
}
$data = $arr;
$encoded = json_encode($data);
oci_free_statement($stid);
oci_close($conn);
echo $encoded;

bocockli
3 Feb 2010, 1:59 PM
If you resize the browser frame, does the data appear?

FaridJC
3 Feb 2010, 2:02 PM
If you resize the browser frame, does the data appear?

Hey, thanks for the tip, but I managed to solve it. There was something wrong in my HTML code, some comment or something......but I still hate IE


Edit: Admin. can delete this thread. Thank you