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
extending the editoption readonly
22/06/2009
08:05
Avatar
Markus
Member
Members
Forum Posts: 15
Member Since:
15/04/2009
sp_UserOfflineSmall Offline

Hi

i want to extend the meaning of the editoption readonly. Currently there will be only a inputfield, which is disabled. I don't like this behabiour of the jqgrid here.

If i set editable=true and readonly=true the values of these colums will be transfered to the server after storing a record, but there is always a disabled input box visible and that is realy confusing for a user.

I did the following changes to the files to prevent the grid to display input fields:

jqGrid\\js\\grid.inlinedit.js(31): if ( nm !== 'cb' && nm !== 'subgrid' && $t.p.colModel[i].editable===true && !($t.p.colModel[i].editoptions && $t.p.colModel[i].editoptions.readonly === true) && !hc) {
jqGrid\\js\\grid.inlinedit.js(78): if( $t.p.colModel[i].hidden===true || ($t.p.colModel[i].editoptions && $t.p.colModel[i].editoptions.readonly === true)) { tmp[nm] = $(this).html(); }

jqGrid\\js\\grid.formedit.js(433): if((obj.p.colModel[i].editrules && obj.p.colModel[i].editrules.edithidden == true) || (obj.p.colModel[i].editable===true && obj.p.colModel[i].editoptions && obj.p.colModel[i].editoptions.readonly === true)) {
jqGrid\\js\\grid.formedit.js(478): if((obj.p.colModel[i].editrules && obj.p.colModel[i].editrules.edithidden === true) || (obj.p.colModel[i].editable===true && obj.p.colModel[i].editoptions && obj.p.colModel[i].editoptions.readonly === true)) {

jqGrid\\js\\grid.celledit.js(64): if ($t.p.colModel[iCol].editable===true && !($t.p.colModel[iCol].editoptions && $t.p.colModel[iCol].editoptions.readonly === true) && ed===true) {
jqGrid\\js\\grid.celledit.js(287): if ( $t.p.colModel[i].editable ===true && !($t.p.colModel[i].editoptions && $t.p.colModel[i].editoptions.readonly === true)) {
jqGrid\\js\\grid.celledit.js(307): if ( $t.p.colModel[i].editable ===true && !($t.p.colModel[i].editoptions && $t.p.colModel[i].editoptions.readonly === true)) {

I testet the changes in the files for the inline editing. Form- and cellediting is untestet till now, but it should work.

Kind Regards
Markus

23/06/2009
03:04
Avatar
Markus
Member
Members
Forum Posts: 15
Member Since:
15/04/2009
sp_UserOfflineSmall Offline

I forgott to mention that i use the readonly option for a workarround of a bug. When i set editable=false the column is not editable, but the grid don't sumbit the values the server side script. With editable=true and readonly=true the grid sends the content of the column, but what i don't like is that the grid shows a disabled input box in the inline edit mode.

23/06/2009
07:12
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Markus,

You can do this in inline edit without these changes in the code.

Here is the easy way

1. Before edit the row get the data from it using getRowData let say myextdata

2. Remove the values myextdata that are editable

(I think there is a easy way to construct this array. Maybe you will get only the values that are needed and construct the appropriate array)

3. Before posting to the server set the extraparam=myextdata

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/06/2009
10:44
Avatar
Markus
Member
Members
Forum Posts: 15
Member Since:
15/04/2009
sp_UserOfflineSmall Offline

but this is also a workaround and i thought you can implement this or another solution to solve this problem

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
48 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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information