Edit data

QuestionsEdit data
Rheal asked 9 years ago

I have a field that has a pull down value.
See below.
When a person edits this entry I only want this field to display in the edit window if the current value of this field Dose not equal "Processing"
Could someone help please.

$col = array();
$col["title"] = "Status";
$col["name"] = "Status";
$col["width"] = "5";
$col["editable"] = true;
$col["edittype"] = "select";
$col["editoptions"] = array("value"=>'Pending:Pending;Accepted:Accepted;Rejected:Rejected');
$col["hidden"] = false;
$col["align"] = "left";
$col["show"] = array("list"=>false,"edit"=>true,"add"=>false);
$cols1[] = $col;

1 Answers
Abu Ghufran answered 9 years ago

You can use event:
$opt["edit_options"]["afterShowForm"] = 'function () { …. }';
$g->set_options($opt);

In this function, you can check value of status using jquery $('#status').val() … and when hiding condition met, you can hide whole tr with id tr_status
$('#tr_status').hide();

You can inspect using firebug (f12) debugger to check element ids iinside edit dialog.

Your Answer

14 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?