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
grid updates
03/01/2009
18:55
Avatar
dhoover
Member
Members
Forum Posts: 23
Member Since:
28/12/2008
sp_UserOfflineSmall Offline

I have 2 grids on one page. One of the grids (A) has a column of edittype select that is populated by options from rows of the other grid (B: in this case I do not want to use subgrid). If the rows in B change (primarily adds and deletes), I want that to be reflected in the add/edit form in A. I am currently able to update the options, but I do not know how to do it in all cases.

I have been experimenting with various events in both grids, but still do not have a complete solution. Any ideas?

05/01/2009
02:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Do you have try getColProp, setColProp methods?

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

06/01/2009
18:07
Avatar
dhoover
Member
Members
Forum Posts: 23
Member Since:
28/12/2008
sp_UserOfflineSmall Offline

I have this same code in both grids:

loadComplete: function() {
                $.get('xdb.php?oper=pulldown&entity=domain_registrar', null, function(myselects, status) {
                     if (status == "success")
                     {
                         var colProps = $('#domains-list').getColProp('registrar');
                         colProps.edittype = 'select';
                         colProps.editoptions = {value: myselects};
                         $('#domains-list').setColProp('registrar', colProps);
                     }
                });
            }

but that does not seem to do what I want, which is to update the grid containing the select pulldown based on change to the other grid.

I have the options for the grids set to reoladAfterSubmit for add, edit, and del operations.

08/01/2009
08:43
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Ok. I understand what you mean. This will not work in your case. The problem is that you already call for the first time the edit form. This form contain the already select options. You have IMHO two possible solutions.

1. Use the code provided from you und the option recreateForm: true

This will cause every time when you cal the form to be recreated with the new values from select.

2. Check to see if the edit form exists and only modify the select option of the field. If the form does not exists it is not needed to do anything. Also you need to write your own code to update the select.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

08/01/2009
15:14
Avatar
dhoover
Member
Members
Forum Posts: 23
Member Since:
28/12/2008
sp_UserOfflineSmall Offline

Thanks Tony. As to #1, is that in the documentation someplace? I looked in the PDF and couldn't find it.

As to #2, I don't understand what you are saying in the first 2 sentences. And, I am attempting to update the select with the ajax $.get call. Or is that not what you mean?

Thanks.

09/01/2009
08:55
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

1.It is a new option. It is not in the pdf, but in the documentation page. I suggest to use online docs if possible. (will update the pdf soon)

2. If you are sure that the edit form already exixsts you should provide the data not as  value:text;...., but as true <option value='1'>text1</option>...

then

if( $("#editmodMyGrid").html() !=null) // we have the modal

$("#myselect").empty().html(the_request_here);

}

Where MyGrid is the id of the grid and myselect  is the name from colModel of the select.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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