jquery - jqGrid: Disable form fields when editing -
I am currently developing a web application designed for the administration of vending machines and in this way I have used jQuery for this project I have decided to use jQuery UI and jqGrid, so I can easily provide a great and highly customizable user interface.
Unfortunately, is too old and it does not cover all the features of this great plug-in (because I really do this, even if the documentation is not bad).
Still, enough background information, I think, go to the point:
I use the navbar created in Jabrid to add, edit and delete objects from the grid.
I have found this work similar to an attraction, except one thing: Some fields can only be enabled (or visible) when adding a new item and not when in editing-mode (they are hidden and / or disabled) needed).
Example:
I am working to sell vending towers and there are many types of these towers (different sizes and accessories). But if a new tower is added and the system is entered, then the type should be set. But the tower does not magically vary with time, so this area can not be edited later.
Does anyone know that this behavior can be accomplished by changing some initial parameters?
Maybe this is an inappropriate editing-choice ( editing options ) or form-choice ( formoptions )? Or maybe you have found a simple solution for this?
I would love to hear your suggestion / solution!
thanks =)
You can apply your needs in different ways, for example For before ShowForm
you can hide or show inside the event
jQuery ("# list"). JqGrid ('navGrid', '#Pager', {edit: true, add: jqGrid ({colModel: [{name: 'name' (width: 200, editable: true}, // ...} Add option before the form: Function (form) {$ ('# tr_Name', form) .hide ();}}, {// Show option before form: function {$ ('# tr_Name' , Form) .show ();}});
Where id "tr_Name" is created with "tr_" prefix and "name" - colmodel
From the property of the name of the column.
Renewed : Another way is to show that the properties are accelerated before editing
Renew 2 : Callback function or "disabled"
, "hidden"
Or allows to define
editable
as "readonly". Seeing it allows you to make the same requirements easier.
Comments
Post a Comment