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
GridToForm does not select from drop down boxes
30/07/2010
17:47
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

Not sure if anyone else has this issue, when I use the GridToForm option, all the textboxes are populated correctly with data from the grid, but my drop down boxes remain untouched, does jqGrid's GridToForm support that?

                { name: 'ParkAndInfluenceTypeDTO', index: 'ParkAndInfluenceTypeDTO', width: 100, editable: true, sortable: true, align: "left", resizable: true, edittype: "select", editoptions: { value: allParkAndInfluenceTypes }, editrules: { required: true }, search: true },
                { name: 'VOUrl', index: 'VOUrl', width: 155, editable: true, sortable: true, align: "left", resizable: true, edittype: "select", editoptions: { value: allVOs }, search: true },
                { name: 'ObjectionUrl', index: 'ObjectionUrl', width: 155, editable: true, sortable: true, align: "left", resizable: true, edittype: "select", editoptions: { value: allObjections }, search: true },

        onSelectRow: function(rowId) {
            var gridSelRow = $(item).getGridParam('selrow');
            if (gridSelRow) {
                $(item).GridToForm(gridSelRow, '#ParkAndInfluencActionsDetails');
            }
        },

               <label class="required" for="ParkAndInfluenceTypeDTO">P&amp;I Type :</label>
                <span class="mvcWrapper required"><select name="ParkAndInfluenceTypeDTO" id="ParkAndInfluenceTypeDTO" class="required"><option value="17″>Create/Maintain Perception</option>
<option value="16″>Help overcome a specific Objection</option>
<option value="15″>Help with a specific VO</option>
<option value="19″>Other</option>
<option value="18″>Plan to Deliver Value</option>
</select></span>      
                <br>
                <label class="" for="VOUrl">VO :</label>
                <span class="mvcWrapper"><select name="VOUrl" id="VOUrl"><option value="">…</option>
<option value="374″>some VO comment</option>
<option value="507″>another VO comment</option>
</select></span>      
                <br>
                <label class="" for="ObjectionUrl">Objection :</label>
                <span class="mvcWrapper"><select name="ObjectionUrl" id="ObjectionUrl"><option value="">…</option>
<option value="300″>some objection</option>
<option value="188″>another objection</option>

03/08/2010
11:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

The problem here is that getRowData used in this case will return the text and not the value. One possible solution is to set for these fields formatter:"select".  In this case getRowData will retun the value and not the text.

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.

03/08/2010
20:50
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

Thanks for the tip Tony. With this the value will show up in stead of the text in the grid, so for example <option value="300″>some objection</option> will show "300" whereas I want the user to see the text value. BTW, I am using version 3.4. Does this mean I must create 2 versions of the column, 1 for viewing that simply has the text value, and another hidden that contains the key value - "300" in this example - that will populate the from drop down correctly?

03/08/2010
23:11
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

Here is the solution:

Domain Model properties (C#):

        public string ObjectionDescription
        {
            get { return _objection != null ? _objection.Description : ""; }
        }

        public string ObjectionDTO
        {
            get { return _objection != null ? _objection.Id.ToString() : "0"; }
        }

colModel:

                { name: 'ObjectionDescription', index: 'ObjectionDescription', width: 155, sortable: true, align: "left", resizable: true, search: true },
                { name: 'ObjectionDTO', index: 'ObjectionDTO', hidden: true, edittype: 'select', editoptions: { value: allObjections} },

Of course the issue is that when using formatter: 'select' you must display the value and not the text, which is not what I want, therefore the solution recommended here is the only one I know, please advise. When I specify the following, is does not work and doeas not select the corresponding option from the ObjectionDTO select drop down box:

                { name: 'ObjectionDTO', index: 'ObjectionDTO', edittype: 'select', formatter: 'select', editoptions: { value: allObjections} },

Also, since I am using toolbar filtering, using my recomendation is an issue as in stead of drop down boxes for the filters it gives me text boxes to represent as in this example the ObjectionDescription property, which again is not what I want. Tony, seems like a catch 22 here. I don't understand why the formatter: 'select' does not work properly and why I have to display the value and not the text in the grid for it to work. Again, I am using version 3.4

11/08/2010
11:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Sorry to say, but version 3.4 is not supported from our team.

Kind Regard

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.

11/08/2010
15:24
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

Cry When did support stop for 3.4?
Tony, is this issue resolved in version 3.7?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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