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_Related Related Topics sp_TopicIcon
Reloading grid after insert/edit data using custom button
11/06/2013
12:36
Avatar
silver11
Member
Members
Forum Posts: 3
Member Since:
03/06/2013
sp_UserOfflineSmall Offline

i'm using this "new" form editing, as what tony suggest me here, which is actually my own made form and it was called by a custom button. everything seems work well for me except for one thing, i had to refresh/reload the grid manually to see the change i made in the data.

first of all, this is part of my code

 jqGrid('navButtonAdd','#pagerMod',
{caption:"Add",
     onClickButton:function()
     {

     var url = "modform.php";

     window.open(url, "Mod Form", "left=400, top=100, height=500, width=600;");
     }
})
.jqGrid('navButtonAdd','#pagerMod',
{caption:"Edit", onClickButton:function()
{
     var mid = jQuery("#Mod").jqGrid('getGridParam', 'selrow');
     var url = "modform.php";
     var url = url+"?but=edit&mid="+mid;

     if (mid)
          window.open(url, "Mod Form", "left=400, top=100, height=500, width=600;");
     else
     {
          var alertIDs = {themodal:'alertmod',modalhead:'alerthd',modalcontent:'alertcnt'};
          if ($("#"+alertIDs.themodal).html() === null)
          {
               $.jgrid.createModal(alertIDs,"<div>"+$.jgrid.nav.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",
               {
                    gbox:"#gbox_"+$.jgrid.jqID(this.p.id), jqModal:true, drag:true, resize:true,
                    caption:$.jgrid.nav.alertcap, top:100, left:100, width:200, height:'auto', closeOnEscape:true,
                    zIndex: null
               },"","",true);
          }
          $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$.jgrid.jqID(this.p.id),jqm:true});
          $("#jqg_alrt").focus();
     }
}
})

the modform.php is a file where i wanna insert the data into database (sql server). after the data successfully inserted/edited, i want the grid to refresh himself just like after we click submit button when we do form editing.

so can any of you guys tell me how can i do this? i've also used $("#Mod").trigger("reloadGrid") before the close of onClickButton function but it affects nothing

regards and thanks in advance

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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