add/edit issues with FK in the grid.

Questionsadd/edit issues with FK in the grid.
Prashant asked 11 years ago

Hi,
I've couple of issues with add/edit in the grid. Not sure if I am doing something wrong.

1) I've a grid with columns lets say col_1, col_2, col_n. I do not wish to edit column col_1 value but other columns can be edited but col_1 should be editable when I add a new row.
I've tried
$col["show"] = array("list"=>true, "add"=>true, "edit"=>false, "view"=>true);
But no success.

2) I've a grid showing data from other table with FK reference. Values are being displayed correctly but I am not able to edit/add rows.
I've searched throw the forums here and crossed checked that PK is already set.

here is code of the column

$col = array();
$col["title"] = "Alert type"; // caption of column
$col["name"] = "alert_type_id"; // grid column name, same as db field or alias from sql
$col["dbname"] = "alert_type.id";
$col["editable"] = true;
$client_lookup = $g->get_dropdown_values("select distinct id as k, name as v from alert_type");
$col["edittype"] = "select";
$col["editoptions"] = array("value" => $client_lookup);
$col["editrules"] = array("required"=>true);
$col["width"] = "30";
$cols[] = $col;

any help would be appreciated.

Regards
Prashant

1 Answers
Abu Ghufran answered 11 years ago

Both options are available in licensed version.

For #1, your solution is correct but might need updated version.
For #2, you need to use custom on_update events and grid by default do DML operations on only one table. Refer dropdown.php for more help in package (if using licensed version)

Your Answer

18 + 20 =

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?