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
Customize the confirmation window
Tags: delete
17/09/2010
02:53
Avatar
tjones1105
Member
Members
Forum Posts: 18
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

Hello,

I would like to know how to customize the Delete row modal dialog window? I would like it to "Are you sure you want to delete $variable_Name?" instead of "Delete selected record(s)?"

How do I do this?

Thanks,

tom

17/09/2010
15:40
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

The answer on your question depends on how you use delGridRow: directly of indirectly (per navGrid for example). In general you can include in the list of delGridRow options any options from $.jgrid.del inclusive msg. So you can sure

delGridRow(rowId, {msg: "Are you sure you want to delete BlaBlaBla?"});

you can also set msg parameter of delGridRow as a part of prmDel parameter of the navGrid function.

If you want to have the text absolutely dynamically you will probably have to use beforeShowForm event handle of the delGridRow.

Best regards
Oleg 

18/09/2010
00:35
Avatar
tjones1105
Member
Members
Forum Posts: 18
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

I apriciate your response, but I'm just as confused.

I'm trying to figure out how to add the row id and then maybe some cell text to the "msg:" statement. 

Thanks,

tom

jQuery("#list").jqGrid('navGrid','#pager',
            {edit:false,view:true}, //options
            {}, // edit options
            {height:290,reloadAfterSubmit:false,jqModal:false, closeOnEscape:true,bottominfo:"Fields marked with (*) are required", closeAfterAdd: true}, // add options
            {reloadAfterSubmit:true,jqModal:true, closeOnEscape:true, caption: "Delete...", msg: "Delete me now!"+rowid}, // del options
            {closeOnEscape:true}, // search options
            {height:250,jqModal:false,closeOnEscape:true} // view options
            )};
18/09/2010
20:11
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tom!

You current code will be run only one time - at the initialisation time when you call 'navGrid' function. I wrote you before that if you want to have dynamic message (if the text will be different at different calls) like you as want you have to do this in beforeShowForm event handle. You can do like following

jQuery("#list").jqGrid('navGrid','#pager',
            {edit:false,view:true}, //options
            {}, // edit options
            {height:290,reloadAfterSubmit:false,jqModal:false, closeOnEscape:true,bottominfo:"Fields marked with (*) are required", closeAfterAdd: true}, // add options
            {reloadAfterSubmit:true,jqModal:true, closeOnEscape:true,caption: "Delete…",width:300
              beforeShowForm: function(form) {
                  $("td.delmsg",form).html("Do you really want delete the row with <b>id=" +
                                                      jQuery("#list").jqGrid('getGridParam','selrow') + "</b>?");
                }
}, // del options
            {closeOnEscape:true}, // search options
            {height:250,jqModal:false,closeOnEscape:true} // view options
            )};

It is an example only what you can do to ovewrite the default text. On the page http://www.ok-soft-gmbh.com/jq.....DelMsg.htm you can how it work live. I changed the width parameter of the delete message box only to make it without scroll bar. You can choose the value of width depend on the size of the text which you will display.

Best regards
Oleg

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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