Forum


13:30

26/05/2011

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!
14:12

Moderators
30/10/2007

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.
14:38

26/05/2011

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
15:53

Moderators
30/10/2007

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.
16:27

26/05/2011

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
21:38

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66