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
Form Edit: One Select Combo -> Multple Columns Split on Select/Insert/Update/Delete
26/05/2011
13:30
Avatar
p2pow350
Member
Members
Forum Posts: 32
Member Since:
26/05/2011
sp_UserOfflineSmall Offline

Hi,

I'm working with some grids and everything is OK! It's a little difficult to start and understanding all the features/philosophy behind the grid but it needs to work hard to mastering this grid, btw..

...I'm trying to build a combobox on Edit/Update/Delete on each record that will put the ID in one field and the Value in another field, is this possible?

Are there example on it?

Thank you!

26/05/2011
14:12
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Not sure I understand what you ask.

Should I understand that you think about dependent list boxes?

Regards

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.

26/05/2011
14:38
Avatar
p2pow350
Member
Members
Forum Posts: 32
Member Since:
26/05/2011
sp_UserOfflineSmall Offline

Hi Tony,

thanks for your reply!

I don't want to create a dependent combo box, I would like to split values for a single combo in different columns.

Please consider this classic example (modified of course):

{name:'ship_sel',index:'ship_sel', editable: true,edittype:"select",editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}},

{name:'ship_id',index:'ship_id'},

{name:'ship_value',index:'ship_value'},

I want to put the "FE" value in an "ID Column", in this case ship_id

and the "FedEx" value in a "Value Column", in this case ship_value

My "ship_sel" combobox will be a third column and is created with a PHP code based on decode table, so I want to create a selection combo and use the selected value to populate different columns. This seems to be difficult also for Select/Update/Delete operations, right?

I hope to clarified my question now

Thank you

26/05/2011
15:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks I think it is clear.

In order to help - Imagine there is no jqGrid. How you will realize this without using the jqGrid add/edit/delete?

Suppose you use a form and beside this form you have two additional elements where you put in one the id and in the other the value!

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.

26/05/2011
16:27
Avatar
p2pow350
Member
Members
Forum Posts: 32
Member Since:
26/05/2011
sp_UserOfflineSmall Offline

Hi Tony,

in the past I've used this javascript function to put appropriate values into other form fields:

    function handleSelectClick() {
        //accessing combo select object
        selectObj = document.forms[0].ship_sel;
            if ((selectObj.value) == "") {
                return false
        }
    
        //reading values
        selectedValue = selectObj.options[selectObj.selectedIndex].value;
        selectedText = selectObj.options[selectObj.selectedIndex].text;
        
        //putting values into appropriate form fields
        document.forms.MyShipmentForm.ship_id.value=selectedValue;
        document.forms.MyShipmentForm.ship_value.value=selectedText;
        
    }

But, how to implement this also in the jqGrid?

Especially, this select will be only used on Edit/Insert of new/old values.

Thank you!!

Max

26/05/2011
21:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You already solove you problem 80% with this script.

You will need to read in wich grid edit/add events to put it.

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:
56 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