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
Edit or Add Form not closing after succesfull submit
23/04/2012
22:28
Avatar
Fridge78
New Member
Members
Forum Posts: 1
Member Since:
23/04/2012
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
59 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