Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






Edit or Add Form not closing after succesfull submit

No Tags
UserPost

22:28
23/04/2012


Fridge78

New Member

posts 1

Hi all,


im new to jqgrid and wanted to start to give a thumbs up for Tony. What a great tool, thank you!

but im stuck with something:

when i add/edit a row below the add/edit form is not closing, but the data is submitted succesfully, could anybody give me a hand?

<table id="overzicht_oefeningen"></table>
<div id='oefening_overzicht'></div>
<script>
jQuery("#overzicht_oefeningen").jqGrid({
    height:300,
    url:'index.php?module=ajax&actie=load_oefening_overzicht',
 datatype: "json",
    colNames:['id', 'Naam','Omschrijving','Acties'],
    colModel:[
     {name:'id',index:'id', width:20, editable:false},
     {name:'naam',index:'naam', width:200, editable:true},
        {name:'omschrijving',index:'omschrijving', width:250, editable: true},
        {name:'act',index:'act',width:180,sortable:false}
       
    ],
    rowNum:-1,
    sortname: 'id',
    viewrecords: true,
    sortorder: "asc",
    hidegrid:false,
    caption:"Overzicht Oefeningen",
    pager: '#oefening_overzicht',
    editurl:"index.php?module=ajax&actie=save_oefening",
    gridComplete: function(){
  var ids = jQuery("#overzicht_oefeningen").jqGrid('getDataIDs');
  for(var i=0;i < ids.length;i++){
   var row = ids[i];
            var cl = $('#overzicht_oefeningen').getCell(row, 'id');
   SetEigenschappen = "<input style='height:22px;width:175px;' type='button' value='Wijzig Eigenschap' onclick="window.location='index.php?module=admin&actie=wijzig_eigenschappen&id="+cl+"'"  />";
   jQuery("#overzicht_oefeningen").jqGrid('setRowData',ids[i],{act:SetEigenschappen});
  } 
 },


});
jQuery("#overzicht_oefeningen").jqGrid('navGrid','#oefening_overzicht',
    {
        edit:true,
        add:true,
        del:true
    },
    {
        //edit options 
       
        closeAfterEdit: true,
        reloadAfterSubmit:true,
        closeOnEscape:true,
        afterSubmit: function(response, postdata)
        {
            var json = eval('(' + response.responseText + ')');
            if(json.success == "true")
            {
                return [true,'',''];
            }
            else
            {
                return [false,json.message,''];
            }
        }
    },
    {
        //add options
        closeAfterAdd: true,
        reloadAfterSubmit:true,  
        closeOnEscape:true,
        afterSubmit: function(response, postdata)
        {
            var json = eval('(' + response.responseText + ')');
            if(json.success == "true")
            {
                return [true,'',''];
            }
            else
            {
                return [false,json.message,''];
            }
        }
    }
   
    );

</script>



thanks in advance for your time/effort.


kind regards


Paul

No Tags

About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

20 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9596

Posts: 28792

Membership:

There are 10192 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1157

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (7010 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information