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
Dynamic Edit / Add / Delete Caption on FormEdit
07/11/2010
01:28
Avatar
BenRivera
Member
Members
Forum Posts: 11
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

I am using a FormEdit dialog box with the Navigation bar icons.

  1. I would like the set the editCaption and delCaption to display data based on the row selected.
  2. I am also using one grid to load data into another, I am passing data in editData array, but would like to set addCaption to display some of the data.

Is this possible?  Everythiing I have tried never changes the caption.

Thanks

Ben

09/11/2010
14:11
Avatar
rmvenancio
Portugal
Member
Members
Forum Posts: 12
Member Since:
09/11/2010
sp_UserOfflineSmall Offline

About the second question you can do this :

Add the onSelectRow on the first grid

onSelectRow: function (ids) {
       
          jQuery("#Detail").setGridParam()
               .setCaption("New Caption")
               .trigger('reloadGrid');
      }

I'm trying to find a way to do the same you requested in point 1.

09/11/2010
22:42
Avatar
BenRivera
Member
Members
Forum Posts: 11
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

rmvenancio said:

About the second question you can do this :

Add the onSelectRow on the first grid

onSelectRow: function (ids) {
       
          jQuery("#Detail").setGridParam()
               .setCaption("New Caption")
               .trigger('reloadGrid');
      }

I'm trying to find a way to do the same you requested in point 1.


Yes, this works, I am currently do this, but that only works for the main grid Caption not the FormEdit Caption.

onSelectRow: function(rowid) {
            if (rowid != tabSelectedRowid){
                tabSelectedRowid = rowid;
                jQuery("#tabsdetail").jqGrid('setGridParam',{
                    url:"profile_tabs_detail_data.php?id="+rowid,
                    page:1
                });
                jQuery("#tabsdetail").jqGrid('setCaption',"Tab Detail: "+ jQuery(this).getCell(rowid,'dash_tab'))
                .trigger('reloadGrid');
            }
        }

10/11/2010
00:54
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello BenRivera,

I would recommend you to use beforeShowForm and afterclickPgButtons event handler to change the title of the edit dialog, because editCaption not support functions as a value. I created a small demo for you.

Exactly in the way you can use beforeShowForm for delete parameters

var title = $("#delhd"+grid[0].id+ " .ui-jqdialog-title");

instead of

var title = $("#edithd"+grid[0].id+ " .ui-jqdialog-title");

to find the title of the dialog.

Best regards
Oleg 

10/11/2010
02:19
Avatar
BenRivera
Member
Members
Forum Posts: 11
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

Oleg, thanks for the example and code.  It works perfectly for Edit and Delete.

I tried using the edit version for Add dialog, but it doesn't work.  I looked at the grid.formedit.js and it is uses the same modalhead

Regards

Ben

10/11/2010
18:35
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Ben,

I not quite understand which text you want to place in Add dialog? If you want a static text you can use addCaption parameter. If you know any rule to generate a title dynamically you can do all exactly like for the Edit dialog. You should just add parameters for the Add dialog as a navGrid parameter (see parameter prmAdd here).

Best regards
Oleg 

11/11/2010
04:45
Avatar
BenRivera
Member
Members
Forum Posts: 11
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

Thiis ithe why I am looking to add data to the addCaption heading:

Grid_1 = Parent table, add, edit delete is available.

Grid_2 = Child Table, has edit and delete icon, but no add.  Adding is done using Grid_3

Grid_3 = Large List of values with descriptions and other data. 

On double click of a row in Grid_3, I check that a row is selected in Grid_1 and call Grid_2.jqGrid('editGridRow', "new",...) to add a new row.  I have tried setting the addCaption in this call to display the description of the data key being added, but it doesn't do anything. 

Since the data keys description in Grid_2 is not editable, it does not diplay in the form.  So I want to display it in the heading.

Thanks for working with me on this,

Ben

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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