Forum

July 12th, 2025
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
How/where do I code jqGrid's afterRefresh event?
19/06/2012
21:46
Avatar
Bill
New Member
Members
Forum Posts: 2
Member Since:
19/06/2012
sp_UserOfflineSmall Offline

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
       }
      }           
     );

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

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