Forum
Topic RSS
08:18
26/02/2009
OfflineHi
i have a problem…
in subgrid is it possible in line editing tecnique? and if possible how?
onSelectRow: function(id){ if(id && id!==lastSel)
{
jQuery("#subgrid_table_id").restoreRow(lastSel);
var chiave = $("#subgrid_table_id").getCell(id,0);
jQuery("#subgrid_table_id").editRow(id,true,on_edit,checksave,'update_dovuti.php?chiave='+chiave);
lastSel=id;
}
}
this does not work! 🙁
14:45
Moderators
30/10/2007
OfflineHello,
The subGrid should be created first and then use this in the subgrid code.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
04:14
26/02/2009
OfflineHello Tony
i do it... where is the problem?
there are \\ beacause i have insert the code js with echo in php
jQuery(document).ready(function(){
var lastSel ;
var gridimgpath= \\"themes/basic/images\\";
jQuery(\\"#s2list\\").jqGrid({
url:'dovuti.php?q=2&data_inizio=".$data_inizio."',
datatype: \\"json\\",
colNames:['id_az','ragione','piva','cf','GEN','FEB','MAR','APR','MAG','GIU','LUG','AGO','SET','OTT','NOV','DIC','totale' ],
colModel :[
{name:'id_az', index:'id_az',width:0,align:'right',editable:false,hidden:true,sortable:true},
{name:'ragione', index:'ragione',width:150,align:'left',editable:false,sorttype:'text',sortable:true},
{name:'piva', index:'piva',width:60,align:'left',editable:false,sorttype:'text',sortable:true},
{name:'cf', index:'cf',width:60,align:'left',editable:false,sorttype:'text',sortable:true},
{name:'Gennaio', index:'Gennaio',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Febbraio', index:'Febbraio',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Marzo', index:'Marzo',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Aprile', index:'Aprile',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Maggio', index:'Maggio',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Giugno', index:'Giugno',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Luglio', index:'Luglio',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Agosto', index:'Agosto',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Settembre', index:'Settembre',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Ottobre', index:'Ottobre',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Novembre', index:'Novembre',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'Dicembre', index:'Dicembre',width:30,align:'left',editable:false,sorttype:'float',sortable:false,edittype:'select', editoptions:{value:\\":\\"}},
{name:'totale', width:50,index:'Totale',align:'left',editable:false,sorttype:'float',sortable:true,edittype:'select', editoptions:{value:\\":\\"}},
],
//toolbar : [true,\\"top\\"],
rowNum:20,
rowList:[10,20,30],
gridimgpath: \\"themes/basic/images\\",
imgpath: \\"themes/basic/images\\",
pager: jQuery('#s2pager'),
sortname: 'id_az',
viewrecords: true,
sortorder: \\"desc\\",
caption:\\"Dovuti\\",
forceFit : true,
cellEdit: false,
cellsubmit: 'clientArray',
hiddengrid: false ,
subGrid: true,
onHeaderClick: function (stat) {
if(stat == 'visible' ){
jQuery(\\"#filter\\").css(\\"display\\",\\"none\\");
}
},
subGridRowExpanded: function(subgrid_id, row_id) {
var gsr = $(\\"#s2list\\").getCell(row_id,1);
var subgrid_table_id;
subgrid_table_id = subgrid_id+\\"_t\\";
jQuery(\\"#\\"+subgrid_id).html(\\"<table id='\\"+subgrid_table_id+\\"' class='scroll'></table>\\");
jQuery(\\"#\\"+subgrid_table_id).jqGrid({
url:\\"sub_grid_dovuti.php?q=2&data_inizio=".$data_inizio."&id=\\"+gsr,
datatype: \\"json\\",
colNames:['id','nome','cognome','GEN','FEB','MAR','APR','MAG','GIU','LUG','AGO','SET','OTT','NOV','DIC','tot','aggiungi+'],
colModel: [
{name:'id',index:'id', key:true},
{name:'nome',index:'nome'},
{name:'cognome',index:'cognome'},
{name:'Gennaio', index:'Gennaio', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Febbraio', index:'Febbraio', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Marzo', index:'Marzo', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Aprile', index:'Aprile', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Maggio', index:'Maggio', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Giugno', index:'Giugno', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Luglio', index:'Luglio', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Agosto', index:'Agosto', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Settembre', index:'Settembre', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Ottobre', index:'Ottobre', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Novembre', index:'Novembre', align:'left',editable:true,sorttype:'float',sortable:false},
{name:'Dicembre', index:'Dicembre',align:'left',editable:true,sorttype:'float',sortable:false},
{name:'totale', width:50,index:'Totale',align:'left',editable:false,sorttype:'float',sortable:true,edittype:'select', editoptions:{value:\\":\\"}},
{name:'aggiungi+',index:'aggiungi+'}
],";?>
//width:100+"%",
height: 100+"%",
rowNum:20,
cellEdit: true,
imgpath: gridimgpath,
onSelectRow: function(id){ if(id && id!==lastSel)
{
jQuery("#subgrid_table_id").restoreRow(lastSel);
var chiave = $("#subgrid_table_id").getCell(id,0);
jQuery("#subgrid_table_id").editRow(id,true,on_edit,checksave,'update_dovuti.php?chiave='+chiave);
lastSel=id;
}
},
sortname: 'id',
sortorder: "asc"
})
},
})
......
..........
03:27
Moderators
30/10/2007
OfflineHello,
And what does not work? What is the error if any?
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:15
Moderators
30/10/2007
OfflineHello,
if you enable cellEdit - onSelectRow is not raised.
In this case use beforeEditCell instead.
You try to combine inline edit and cell edit. IMHO this is not a good idea. Use one of them and not both.
If you disable cellEdit - onSelectRow will be raised
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 994
Currently Online:
170 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home