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
Grey out not editable field on edit form
02/02/2009
18:25
Avatar
maggie
Member
Members
Forum Posts: 49
Member Since:
17/12/2008
sp_UserOfflineSmall Offline

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

03/02/2009
01:47
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

03/02/2009
16:54
Avatar
maggie
Member
Members
Forum Posts: 49
Member Since:
17/12/2008
sp_UserOfflineSmall Offline

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

 

 

05/02/2009
01:44
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

09/02/2009
11:09
Avatar
maggie
Member
Members
Forum Posts: 49
Member Since:
17/12/2008
sp_UserOfflineSmall Offline

Hello,

I figured out how to call onInitializeForm, but I don't know the syntax to set the needed color for a field such as invid on the edit form. Where can I find an example from the documentation?

Thanks!

Maggie

10/02/2009
23:19
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

20/02/2009
17:58
Avatar
maggie
Member
Members
Forum Posts: 49
Member Since:
17/12/2008
sp_UserOfflineSmall Offline

This helps!

Thanks! Maggie

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information