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
visible but not editable in a edit record form
19/11/2009
11:38
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

Please, could you confirm me that this is impossible:

- to have a field visible but not editable in a row

and

- to have this field visible but not editable in a edit record form

I believe that if a field is not editable then it is not visible in a form

Or do you have a "trick" ?

19/11/2009
12:45
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

editoptions:{readonly:"readonly"}

Mark

20/11/2009
04:54
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

YES ! very good.

Now I must change the color in the form because I don't see the difference with the other fields.

Thank you.

20/11/2009
05:13
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

I replied too quickly ...

because now I cannot create a record ...

In fact I must have two forms: one for the creation and one for the edition/modification.

Is it possible to have different forms ?

20/11/2009
09:07
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

phicarre said:

I replied too quickly …

because now I cannot create a record …

In fact I must have two forms: one for the creation and one for the edition/modification.

Is it possible to have different forms ?


In that case you can set recreateForm true (so that the form gets rebuilt every time you click the add or edit buttons), and use onBeforeInit to set/clear the readonly attribute in the colModel.

Mark

20/11/2009
09:07
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

phicarre said:

I replied too quickly …

because now I cannot create a record …

In fact I must have two forms: one for the creation and one for the edition/modification.

Is it possible to have different forms ?


In that case you can set recreateForm true (so that the form gets rebuilt every time you click the add or edit buttons), and use onBeforeInit to set/clear the readonly attribute in the colModel.

Mark

20/11/2009
10:36
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

I think that my question is not well formulated or I didn't understand your answer.

(for set/clear attribute: ok)

I have a grid. When I click on one row, a form is displayed for modification/edit. In this case I protect one field with "readonly" as you suggested. I can change all fields excepted this one.

In the pager, I use the "+" for the creation. When I click on it, the same form is displayed BUT, in this case, I want to edit the field.

but it's impossible because of the "readonly" !

That's why I asked if we can have two forms !

20/11/2009
11:33
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Yes. I understood your question.

Just before the form is created, the grid calls your onBeforeInit function (if you have one). You can supply one onBeforeInit function for add, and one onBeforeInit for edit.

Use the onBeforeInit functions to change the editoptions for the column in question (ie add or remove the readonly property from colModel).

You also need to set recreateForm to true, to ensure the form is rebuilt every time you call editGridRow (otherwise it just re-uses the previous form, with new values inserted, and wont call onBeforeInit, or look at your colModel options).

Mark

20/11/2009
16:32
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

When you say onBeforeInit you mean beforeInitData ...

This event occurs when I click the + but not when I click on the row !

For the time beeing I don't see how to change (to address) one of the proprietes of one raw: colModel.index or something like that ?

20/11/2009
17:05
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

Yeah !!!

One time in the navigator (add):

...

recreateForm:true,

beforeInitData: function (formid){jQuery("#list1").setColProp('nom', {editoptions:{readonly:false}}); } ,

...

One time in the Grid:

jQuery("#list1").editGridRow(gr,
{

...

recreateForm:true,
beforeInitData: function (formid){jQuery("#list1").setColProp('nom', {editoptions:{readonly:true}});  },

...

Very good analysis. very good exchange. better that "please consult the doc" ...

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
203 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