Hi Sir!
Please, I'm having two erros:
1) It is displayed a box with the content below:
{"page":"1","total":5,"records":"467","rows":[
{"id":"282","prn":"","cod_cont":"1.00.00.000000","tipoconta":"S","tipo":"D","desc_cont":"ATIVO"},
{"id":"272","prn":"","cod_cont":"1.01.01.000000","tipoconta":"S","tipo":"D","desc_cont":"CAIXA"},
{"id":"273","prn":"","cod_cont":"1.01.01.000001","tipoconta":"A","tipo":"D","desc_cont":"Caixa Principal"}]}
What is this?
2) In code below, sometimes returns "undefined" and other times returns full value (the correct):
$col = array();
$col["title"] = "Saldo (R$)";
$col["name"] = "saldo";
$col["id"] = "saldo";
$col["align"] = "right";
$col["formatter"] = "function(cellvalue, options, rowObject) { return formatPrice(cellvalue, options, rowObject); }";
$cols[] = $col;
function formatPrice(cellvalue, options, rowObject) {
if (typeof(cellvalue) == "undefined") {
return '0,00';
} else {
return moeda(parseFloat(cellvalue));
}
}
Thank you!
1) This is due to some extra white space character, between the call of $g->render(); Please check all include files for ending white space character. Ideally, there must be no output before sent to browser before $g->render().
2) You can debug it by putting alert(cellvalue); for each record, and see which one is producing this error. I cannot exactly tell the reason unless debug it. You can email code+db-dump to regenerate the scenario and check, if not resolved.
Hello,
Can you check what character is it appending before JSON strong.
If you copy (ctrl+c) the alert box, and paste in notepad, it would show you.
Hi Sir!
First error is solved (I used json_encode($retorno) to manipulate portuguese characters in IE).
Now, I'm going debug second error according to your instructions!
Thank you by your support!
Fábio Martins
In second error I put alert(cellvalue) and:
A) When returns undefined value, alert(cellvalue) doesn't called.
B) When returns numeric value, alert(cellvalue) is called.
Please, why my JS script doesn't called all times?
Thank you!
Fábio Martins