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
replace the alert
01/03/2011
10:19
Avatar
elie
Member
Members
Forum Posts: 9
Member Since:
07/12/2010
sp_UserOfflineSmall Offline

hi

 i am using the code below to delete a row everything is fine but i want to know if i can replace the alert  with the warning that appears when i click on delete from the navigator

$("#dedata").click(function(){

var gr = jQuery("#delgrid").jqGrid('getGridParam','selrow');

 if( gr != null ) jQuery("#delgrid").jqGrid('delGridRow',gr,{reloadAfterSubmit:false});

else alert("Please Select Row to delete!"); });

Thanks for help

01/03/2011
10:44
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello elie,

Look at code of the the answer where I showen how the $.jgrid.viewModal method can be used to show the same message like jqGrid do in the navigator.

Best regards
Oleg

$.jgrid.viewModal

01/03/2011
11:56
Avatar
elie
Member
Members
Forum Posts: 9
Member Since:
07/12/2010
sp_UserOfflineSmall Offline

Thank you very much for your answer

but i still have this problem  : $.jgrid.viewModal is not a function

i added :

else{

$.jgrid.viewModal("#alertmod",{gbox:"#gbox_delgrid",jqm:true});

$("#jqg_alrt").focus();

}

  

i am missing something ??

01/03/2011
12:14
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

The message "... is not a function" means that you not included jqGrid module during the downloading of the jqGrid. You should open jquery.jqGrid.min.js, search at the begining of the file for "Modules:" and you the file grid.common.js must be inside.

Moreover I suppose that you use jqGrid version 3.8.2. In some more old versions (inclusive 3.8.2) the viewModal was global function not in the namespace $.jgrid. So in previous version you should use viewModal instead of $.jgrid.viewModal.

Best regards
Oleg 

01/03/2011
13:07
Avatar
elie
Member
Members
Forum Posts: 9
Member Since:
07/12/2010
sp_UserOfflineSmall Offline

Dear Oleg 

i am using the 3.8 version and i have all modules in  jquery.jqGrid.min.js

i think the problem now is from my side because when i click the button  nothing happens but the message " $.jgrid.viewModal is not a function " is gone.

i will try to find what's wrong.

Thank you very much

Regards,

Elie

01/03/2011
14:22
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Elie,

In the previous my post I made typing error. In all old versions before 3.8.2 (inclusive 3.8.1, 3.8) the viewModal was global function not in the namespace $.jgrid. You wrote that you use 3.8, so you should either download jqGrid 3.8.2 which contain many bug fixes and some new features (see here) or use viewModal instead of $.jgrid.viewModal.

Best regards
Oleg 

01/03/2011
14:49
Avatar
elie
Member
Members
Forum Posts: 9
Member Since:
07/12/2010
sp_UserOfflineSmall Offline

Thanks again Oleg for your reply

i tried to use viewModal instead of $.jgrid.viewModal but nothing happens when i click the button.

i will download jqGrid 3.8.2 soon and i will see what will happen

Best Regards

Elie

01/03/2011
15:12
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

I searched in my collection of different demos and fould two examples

The first example use jqGrid 3.7.2. If you clich on the last custom button on the navigator if no row selected you will see warning dialog which are produced with respect of viewModal.

In the next example which use jqGrid 3.8.2 you should confirm twice the "loadComplete is called" message and then click on the "Search" button. If no row selected in the grid you will display warning message with respect of $.jgrid.viewModal.

Best regards
Oleg 

03/03/2011
14:13
Avatar
elie
Member
Members
Forum Posts: 9
Member Since:
07/12/2010
sp_UserOfflineSmall Offline

Dear Oleg,

Thank you for all these usefull examples. They helped me a lot

it is working now with  jqGrid 3.8

Thanks again for your time

Regards,

Elie

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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