Forum
08:05
15/04/2009
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
03:04
15/04/2009
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.
07:12
Moderators
30/10/2007
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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66