I'v buy yesterday the dev version of this amazing grid , all seems to working fine except one little thing.
if i use currency formatter on a column, sum does not work, returning NaN.
if i remove formatter the sum work.
any idea ?
$col = array();
$col["title"] = "Total"; // caption of column
$col["name"] = "amt"; // grid column name, same as db field or alias from sql
$col["width"] = "2"; // width on grid
$col["formatter"] = "currency";
$col["formatoptions"] = " can't post , cause invalid character ?"
var opts = {
'loadComplete': function () {
var grid2 = $("#list2");
grid2.jqGrid('footerData','set', {amt: 'Total: '+sum});
},
};
Hello,
Just remove string 'Total', and it will format $ string.
grid2.jqGrid('footerData','set', {amt: sum});
Hi Abu,
Thanks,it almost works but i must disable formatter to make it work , if i keep formatoptions instead of NaN i have 0,00
with $col["formatoptions"] disabled it write correct sum but without suffix 'euro' and without right decimal seperator on the footer and column.
here is my formatoption now i can post code !
array("prefix" => '',
"suffix" => ' €',
"thousandsSeparator" => ",",
"decimalSeparator" => ".",
"decimalPlaces" => '2');
grid2.jqGrid('footerData','set', {amt:sum});
Thanks for your good work
I checked that there is some issue with using euro sign.
You can use custom formatter in this case.
$col["formatter"] = "function(v){ return v+' €'; }";
$col["unformat"] = "function(v){ return parseFloat(v); }";
Also check this link for using custom formatter.
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter