Forum


18:25

17/12/2008

Hello,
It is great that some fields such as inv no can be set up as not editable on the edit form. But I can't figure out how to grey it out (eg. set the backgroud as grey so that it is obvious that it is not editable). Is that doable?
These are the codes that I set up for not editable form:
colModel :[ {name:'invid', index:'invid', width:60, editable:true,editoptions:{readonly:true,size:10}},
Thanks!
Maggie
01:47

Moderators
30/10/2007

Hello,
This is the right way. If you use FireFox this field is grey. If you use IE this is not gray. It is browser depended. To force this programatically you can use onInitialzeForm to set the needed color for that field.
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:54

17/12/2008

Hello,
I use IE.
I can't find the syntax of using onInitialzeForm on the documentation. Could someone please give me an example? Here is my code for editGridrow. Where should I add onInitialzeForm? what are the parameters?
$("#bedata").click(function(){
var gr = jQuery("#editgrid").getGridParam('selrow');
if( gr != null ) {
jQuery("#editgrid").editGridRow(gr,{width: 400, height:280, modal:false, reloadAfterSubmit:false});
}
else alert("Please Select Row");
});
Thanks, Maggie
01:44

Moderators
30/10/2007

Hello,
There is documentation. From this site Click on Documentation and then
jqGrid->Form Editing->Edit Row - look at events there is example.
In your case
jQuery(”#editgrid”).editGridRow(gr,
{width: 400,
height:280,
modal:false,
reloadAfterSubmit:false,
onInitializeForm : function (formid) {
// your code goes here
}
});
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.
23:19

Moderators
30/10/2007

Hello,
The form has a id formid, everey field in this form has a id equal to the name from colModel. So in you case it can look like
onInitializeForm : function (formid) {
$("#invid",formid).css({your style here - background and so on});
}
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:
44 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