Forum


06:35

20/11/2008

colModel:[ {name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10}}, {name:'invdate',index:'invdate', width:80,editable:true,editoptions:{size:10}}, {name:'name',index:'name', width:90,editable:true,editoptions:{size:25}}, {name:'amount',index:'amount', width:60, align:"right",editable:true,editoptions:{size:10}}, {name:'tax',index:'tax', width:60, align:"right",editable:true,editoptions:{size:10}}, {name:'total',index:'total', width:60,align:"right",editable:true,editoptions:{size:10}}, {name:'closed',index:'closed',width:55,align:'center',editable:true,edittype:"checkbox",editoptions:{value:"Yes:No"}}, {name:'ship_via',index:'ship_via',width:70, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;TN:TNT"}}, {name:'note',index:'note', width:100, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}} ],
this select/dropdown
01:35

Moderators
30/10/2007

Hello,
It is a little difficult, but not impossible.
When you want to add fields? - everey time you open a form or
only once when is already created.
When once use onInitializeForm , when every time you can use
beforeShowForm
I will use onInitializeForm and suppose you want to add field
after the field “myfield” from colModel which is editable
onInitializeForm : function (formid) {
var my_field_pos = $(”#myfield”,formid).parent(”tr:first”)
var elm = “<tr class=”FormData”>
<td class=”CaptionTD”>MyCaption</td>
<td class=”DataTD”><input class=”FormElement”…/></td>
</tr>
$(my_field_po).after(elm)
}
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.
Can you add all fields you may want to “add” by stipulating “hidden: true, hidedlg: true“, and when you want to show it after form has been initialized do :
Of course if you do not know what those field may be this would not work but I cannot imagine that being the case else how would you server-side code know what to return?
Most Users Ever Online: 715
Currently Online:
161 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