Forum


13:33

20/08/2008

Hi,
I use Master Detail demo. When the ParentGrid is selected, it changes the ChildGrid url.
jQuery("#list10_d").setGridParam({url:"subgrid.php?q=1&id="+ids,page:1})
Okay. I added an Edit and Add navGrid. Everything is fine actually. the Edit action is working and so is the Add action.
One thing I found in Add action is, the default value for all of the field is blank. Now, how can I add a custom default value for it? like when the Add button is pressed in the ChildGrid, the custom field value depends on the selected row in ParentGrid ? Maybe when the Add button is pressed, the default Item Name is the same with the selected row Client Name... something like that...
thanks for the help.
00:19

20/08/2008

Well, I managed to solve it somehow. But, I don't know wether this solution is optimal or not.
here's the code:
var master_id = jQuery(gridInits[0].section).getGridParam('selrow');
var masterdata = jQuery(gridInits[0].section).getRowData(master_id);
jQuery("#subject_id",formid).attr("value",masterdata.subject_id);}
First I use:
But not working.
02:45

Moderators
30/10/2007

If you use navigator in add option use beforeShowForm event
something like this:
beforeShowForm : function(form_id) {
if(some_condition) {
jQuery(”#name_from_colmodel”,formid).val(”myvalue”);
}
}
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:
86 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