Forum

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

Search Forums:


 






How/where do I code jqGrid's afterRefresh event?

No Tags
UserPost

21:46
19/06/2012


Bill

New Member

posts 2

I'm new to both jQuery and jqGrid, so I'm still finding my way.  I've gotten jqGrid wo work successfully with regard to editing, deleting, data, etc.  I want to execute a function everytime the "Reload" icon is clicked in the grid navigator.  I tried adding the nec. code in the navigator (see below), but the code isn't getting executed.  I'm sure I'm missing something obvious.  Can anyone help?

     // manage grid navigator buttons
     var resp;         
     $("#CurrMoTime").navGrid("#pagerCurrMo",
      // Navigator options
      {edit:false,
        add:false,
        del:true,
        search:false,
       refresh:true},
      // Edit Options
      {},
      // Add Options
      {},
      // Delete Options
      {// The beforeShowForm property below changes the msg on the delete dialog box that appears
       // when the assoc clicks on the trash can
        beforeShowForm:
        function ($form) {
        $("td.delmsg").html("Delete selected row of Time Detail?");
        },
       onclickSubmit:
       function(id) {
        // Note: rowSeqNum – obtained by onSelectRow event in jqGrid def above (can't use getCell in Edit mode as per doc)
        //       delData – addt'l data sent to identify time detail to delete in ep_associate_time
        //       url – delete cfc/method to call to delete time detail
        //       aftersubmit – examine response returned by ajax call to delete time detail
        jQuery('#CurrMoTime').delGridRow(id,
          {delData: {seqnum:rowSeqNum},
           url:'/cfapp/intranet/apps/rd/cf_components/Time.cfc?method=DelTime&UserId=' + varNulls + '&Password=' + varNulls + '&AssocEmplid=' + AssocEmplid + '&PED=' + CurrMoPED + '&callingpgm=' + PgmId,
           afterSubmit:
           function(response,postdata) {
          if (response.status == 200) {
            $("#delhdCurrMoTime span.ui-icon-closethick").trigger("click");
            updateTotLogged();  // Update the Total Logged Percentage in Time Grid Header           
            cfrmTDTitle = "Delete Request Successful";                       
            cfrmTDContent = "Your request to delete Time Detail has been successfully processed.";
            DispTimedMsg(cfrmTDTitle,cfrmTDContent);
            return true;           
          } else {
            cfrmTDTitle = "";
            cfrmTDContent = "";
            DispTimedMsg(cfrmTDTitle,cfrmTDContent);
            return false;           
          };
           },
           errorTextFormat:
           function (response) {
          // the selectors referenced below pertain to the title and body content of the Delete Dialog box; we are
          // overriding them on error response returned from the server
          $("span.ui-jqdialog-title").html("Delete Failed!");          
          $("#DelError td.ui-state-error").html("Contact ITAC if this problem persists!<br/><br/>Details: Pgm ID " + PgmId + "; CFC.Method – Time.DelTime; Period End Date – " + CurrMoPED + "; Associate ID – " + AssocEmplid + "; Time Detail Sequence # – " + rowSeqNum + ".  Could not delete this row of time detail.  HTTP Response Status – " + response.status + ".");
           }
          }
        );
       }
      },
      // Refresh Options
      {afterRefresh:
       function() {
        window.alert("Got here!!!");
        updateTotLogged();  // Update the Total Logged Percentage in Time Grid Header
       }
      }           
     );

No Tags

About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

45 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9661

Posts: 28950

Membership:

There are 10357 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1167

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

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




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information