I'm trying to hide a Row if a cell in it has the false value, so far I've tried using a formatter like this:
$("#list").jqGrid({
//datatype: 'clientSide',
colNames: ["Id", "Descrizione", "Data Vendita", "Disabilitato", "PISTA",
"Piano Tariffario", "Data Validità Piano Tariffario",
"PROMO", "Data Validità Promo", "CANONE CLIENTE NETTO MESE",
"Vendibile", "Migrato"],
colModel: [
{ name: "id"},
{ name: "descrizione", editable: true},
{ name: "dataInizVendita", editable: true, formatter:vendita},
{ name: "disabilitato", editable: true},
{ name: "pista", editable: true},
{ name: "pianoTariffario", editable: true},
{ name: "dataInizPiano", editable: true, formatter:piano},
{ name: "promo", editable: true},
{ name: "dataInizPromo", editable: true, formatter:promo},
{ name: "canoneNetto", editable: true},
{ name: "disponibilita", editable: true, formatter:mostra},
{ name: "migrato", editable: true, width:150, sortable: false, resizable:false, formatter:bottone}
],
formatter: 'date',
formatoptions: { srcformat: 'd/m/Y', newformat: 'd/m/Y'},
sortname: "id",
sortorder: "asc"
})
The formatter that I care about is mostra, if disponibilita is false, it must hide the row!
function mostra (cellvalue, options, rowObject)
{
if(rowObject.disponibilita == false)
{
$("#"+rowObject.id).hide();
}
$("#list").trigger("reloadGrid");
return rowObject.disponibilita;
}
I've tried using delRowdata too, but it doesn't remove it, and it can see when it's false and when it's not, because the if function works perfectly