0

JQGrid Form edit input screen, Can u give some idea on how to hide the selected area and also to display it on click of the check box.

for example

my form editing window have

show full details check box and First, Last Name, Age, and Address, Zipcode, City, State and Country

if that check box is checked First, Last Name, Age, and Address, Zipcode, City, State and Country fields are shown else all fields are hidden

Is it possible ?

skaffman
  • 398,947
  • 96
  • 818
  • 769

1 Answers1

0

If I understand correct your question you want test the value of some field from the Edit form and hide some other fields of the form depend on the tested value.

You can implement the behavior inside of beforeShowForm callback. If you you have for example column with name: "sold" in the colModel which has formatter: "checkbox" then you will find the corresponding value in the edit form in the checkbox having id="sold". So you can use $("#sold").is(":checked") to test the value. You can do such testing inside of beforeShowForm callback which will be called after the form will be initialized, but before it will be shown. To hide information from "address" column for example you can use $('#tr_address').hide();. The $('#address') represent the input field for the address and $('#tr_address') represents the full row of the edit form with the information.

You can find and example which very close to what you need in the answer.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798