Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Inline editing in subgrid
26/02/2009
08:18
Avatar
marco.qf
Member
Members
Forum Posts: 4
Member Since:
26/02/2009
sp_UserOfflineSmall Offline

Hi

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! 🙁

28/02/2009
14:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

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.

02/03/2009
04:14
Avatar
marco.qf
Member
Members
Forum Posts: 4
Member Since:
26/02/2009
sp_UserOfflineSmall Offline

Hello 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/03/2009
03:27
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

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.

05/03/2009
23:17
Avatar
marco.qf
Member
Members
Forum Posts: 4
Member Since:
26/02/2009
sp_UserOfflineSmall Offline

Hi

the function onSelectRow in subgrid is not called and so the subgrid is not updated

with firebug on firefox there aren't mistakes or errors but the risult is the same.. the subgrid is not updated

19/03/2009
05:46
Avatar
marco.qf
Member
Members
Forum Posts: 4
Member Since:
26/02/2009
sp_UserOfflineSmall Offline

news for me?

21/03/2009
11:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
49 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information