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
Form editing: difference between add and edit.
21/06/2011
23:37
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

Hii, in the documentation it seems that a single colModel property ("editable") specifies if a column must be present in the add panel and the edit panel , but in large number of cases colmuns that I can set in an "add" operation must be not modifiable in "edit" mode (i.e. primary keys, Is there a way to obtain this behaviour?

Thanks

06/08/2011
18:45
Avatar
JerryOfPerth
New Member
Members
Forum Posts: 1
Member Since:
06/08/2011
sp_UserOfflineSmall Offline

r.cappa said:

Hii, in the documentation it seems that a single colModel property ("editable") specifies if a column must be present in the add panel and the edit panel , but in large number of cases colmuns that I can set in an "add" operation must be not modifiable in "edit" mode (i.e. primary keys, Is there a way to obtain this behaviour?

Thanks


If you haven't already found a solution this might help:

jqGrid: Disable form fields when editing

06/08/2011
19:04
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

JerryOfPerth said:

r.cappa said:

Hii, in the documentation it seems that a single colModel property ("editable") specifies if a column must be present in the add panel and the edit panel , but in large number of cases colmuns that I can set in an "add" operation must be not modifiable in "edit" mode (i.e. primary keys, Is there a way to obtain this behaviour?

Thanks


If you haven't already found a solution this might help:

jqGrid: Disable form fields when editing


I've already found this, but it is a workaround. It is not a good way, and not so much intuitive, manually hide unused fields in beforeshow event. It can be useful to configure this in a declarative mode.

06/08/2011
19:54
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello r.cappa and JerryOfPerth,

Thank for the posting. I agree that the requirement to have some fields visible and editable in Add, but not in Edit dialog is a common requirement. jqGrid has some events like afterShowForm, beforeShowForm, beforeSubmit, serializeEditData which can be used to do almost any changes in the form dialog, the editurl or in the data which will be send. Nevertheless some standard actions could be made more easy to use.

If Tony would read the topic it would write my opinion on the subject.

I think it would be very nice to allow the editable property be not only boolean with the data true and false, but to be a string with values like "add", "edit", "add, delete", "add, edit, delete" or something like that. One can instead of that introduce additional property inside of the editoptions which described which edit operation are permitted on the column.

One another close requirement which I see sometime is the requirement to send some grid fields to the server together with the editable fields. Curently there are exist a tricky possibility to define hidden column like

hidden: true, editable: true, editrules: { edithidden: false }, hidedlg: true

to send the data from the column to the server. It's difficult to read and understand. Moreover sometime one needs to send the value of some visible, but not editable column from the grid as the part of the Add/Edit operartion. Not only rowid can be important to for edit operation.

The new property/properties of editoption with some clear name like sendOnEdit, sendOnAdd, sendOnDel could be introduced, which can be used to declare that the field (either hidden or non-hidden non-editable columns) should be send during the corresponding edit operation.

The last suggestion is to define how editurl should be appended. If one uses RESTfull services on the server side the appending of rowid to editurl in Edit or Delete operartion should be implemented. Currently one can use onclickSubmit or beforeSubmit in form editing to modify imediately befor the Ajax requests. In case of inline editing one could construct the url which one needs and use if as the parameter of editRow or saveRow. In case the usage inline editing indirect as the formatter:'actions' the modifying of url could be a little more sofisticated.

A simple in use and in the implementation could be new editUrlTemplate option with the value in the form like "/{id}/{col1Name}" which could define the string which will be appended to the editurl. The values like {id} and {id}/{col1Name} where col1Name is the name property of some column from colModel could be replaced to the corresponding value from the row field. The parameter could be very easy to understand and for the implementation one should just parse the template for the {} and use encodeURIComponent JavaScript function to encode the value from the corresponding column.

I think that such changes in the jqGrid would be very usefull and there are easy to implement.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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