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
Reload After Edit
22/03/2009
12:32
Avatar
grahamm
Member
Members
Forum Posts: 3
Member Since:
22/03/2009
sp_UserOfflineSmall Offline

Hello,

I would like to refresh the grid after being edited. But I do not understand how we use parameters .editRow.
I can not define them.

Is it possible to have a sample code for aftersavefunc?

24/03/2009
02:10
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

See docs how to pass this.

Fomething like this

var myaftersave = function(rowid, response) {

// here your code

}

and then

....editRow(rowid,false,'','','','',myaftersave)

Note that you do not need to call it with params

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.

24/03/2009
13:07
Avatar
grahamm
Member
Members
Forum Posts: 3
Member Since:
22/03/2009
sp_UserOfflineSmall Offline

It doesn't work. Where is my error :

var lastSel

function checksave(result) {
 
    if (result.status != 200) {
        return false;
    }
 
    if (result.responseText.substring(0,2) != "OK") {
        return false;
    }
  return true;
}

function on_edit(result) {
       
      return true;
}

var myaftersave = function (id){
   
    jQuery('#list2').trigger('reloadGrid');
}

jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
   
    url:'agefos.php',
   
    datatype: "json",
   
    colNames:['numero facture','date facture', 'resto', 'numero action','montant ttc','reglement'],
   
    colModel:[
        {name:'numero facture',index:'numero_facture', width:180, align:"center"  },
        {name:'date facture',index:'date_facture', width:180, align:"center", formatter:"date" },
        {name:'resto',index:'id_resto', width:180, align:"center"},
        {name:'numero action',index:'numero_action', width:180, align:"center" },
        {name:'montant ttc',index:'montant_ttc', width:180, align:"center", formatter:"currency", formatoptions:{thousandsSeparator:" ", suffix:" €"}},       
        {name:'reglement',index:'reglement_facture', width:180,align:"center",formatter:"checkbox", editable:true,edittype:"checkbox"    }       
               
    ],
   
    pager: jQuery('#pager1'),
    height:500,
    rowNum:30,
    rowList:[10,20,30],
    imgpath: 'themes/sand/images/',
    sortname: 'id_resto',
    viewrecords: true,
       sortorder: "asc",
    caption: "Agefos",
   
   
   onSelectRow: function(id){
  if(id && id!==lastSel){
    jQuery('#list2').restoreRow(lastSel);
   
    jQuery('#list2').editRow(id, true,on_edit,checksave,'','',myaftersave);
       lastSel=id;
   
       
      
      
      
   
}   
   
},

editurl:'reglement.php',

}).navGrid('#pager1',{});
   

});

Thank you.

26/03/2009
03:47
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Since we have ajax here try with this:

var myaftersave = function (id){
   
    setTimeout( function() { jQuery('#list2').trigger('reloadGrid');},1000);
}

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:
38 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