Master/Detail dynamic column tilte

QuestionsMaster/Detail dynamic column tilte
Raina asked 10 years ago

Hi Abu,
I have a master/detail grid.
How can I change the detail title when I select a row from master grid?
list1:
$col = array();
$col["title"] = "Unit";
$col["name"] = "count_type";
$col["width"] = "15";
$col["editable"] = false;
$col["hidden"] = true;
$col["align"] = "center";
$cols[] = $col;

list2:

$col = array();
$col["title"] = "$a";
$col["name"] = "count_type";
$col["width"] = "15";
$col["editable"] = false;
$col["hidden"] = true;
$col["align"] = "center";
$cols[] = $col;

$a is the value of count_type.

Thanks
Ho

1 Answers
Abu Ghufran answered 10 years ago

For master grid, set onselect event.

$e["js_on_select_row"] = "do_onselect";
$grid->set_events($e);

and in html part add this script.

<script>
function do_onselect(id)
{
var ctype = jQuery('#list1').jqGrid('getCell', id, 'company'); // where invdate is column name
jQuery('#list2').jqGrid('setLabel','company',ctype);
}
</script>

Your Answer

14 + 14 =

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?