var lastSelO="";
$('#config-profili-orari').jqGrid({
datatype: 'json',
url: '/admin/getConfigOrariProfiles',
editurl: '/admin/setConfigOrariProfiles',
method: 'GET',
width: $('body').width()-60,
shrinkToFit: true,
height: "auto",
sortorder: "desc",
regional: 'it',
loadui: 'disable',
pager: '#config-profili-orari_pager',
jsonReader : jsonReader,
colNames:['id','Nome','Descrizione','Mesi','Giorni','Ore','Domain'],
colModel:[
{name:'id',index:'id',hidden: true},
{name:'name',index:'name', editable: true, edittype:'text'},
{name:'description',index:'description', editable: true, edittype:'text'},
{name:'months',index:'months', editable: true, edittype:'select', formatter:'select', editoptions: monthslist},
{name:'weekdays',index:'weekdays', editable: true, edittype:'select', formatter:'select', editoptions: weekdayslist},
{name:'hours',index:'hours', editable: true, edittype:'select', formatter:'select', editoptions: hourslist},
{name:'domain',index:'domain', editable: true, edittype:'select', formatter:'select', editoptions: domainslist}
],
onSelectRow: function(id){
if(id && id!==lastSelO){
jQuery('#config-profili-orari').saveRow(lastSelO);
lastSelO=id;
}
jQuery('#config-profili-orari').editRow(id, true);
},
loadComplete: function() {
$("#config-profili-orari tr.jqgrow:even").addClass('evenRowClass');
$("#config-profili-orari tr.jqgrow:odd").addClass('oddRowClass');
}
})
.jqGrid('navGrid','#config-profili-orari_pager',{
add: true,
del:true,
edit: true,
search: false,
refresh: false
});