Forum

May 22nd, 2014
A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Form editing: difference between add and edit.
21/06/2011
23:37
r.cappa
Member
Forum Posts: 25
Member Since:
06/06/2011
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
JerryOfPerth
New Member
Forum Posts: 1
Member Since:
06/08/2011
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
r.cappa
Member
Forum Posts: 25
Member Since:
06/06/2011
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
OlegK
Germany
Member
Forum Posts: 1219
Member Since:
10/08/2009
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: 215

Currently Online:
63 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1219

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11244

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10448

Posts: 30879

Newest Members: onefootswill, JoHansen, manjunathmaski, blgsyrmhnds, toadicusrex, re-gor

Moderators: tony (7580), Rumen[Trirand] (81)

Administrators: admin (61)

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information