Hello, Abu.
1. I want to create a checkbox: When selected, fill the field with the value of another field in the same table, when not selected leave it blank.
2- In Edit mode excel, my checkboxs not respond to click. This is my code:
$col = array();
$col["title"] = "mes";
$col["name"] = "justifica";
$col["width"] = "50";
$col["align"] = "center";
$col["search"] = false;
$col["editable"] = true;
$col["edittype"] = "checkbox"; // render as checkbox
$col["editoptions"] = array("value"=>"1:0"); // with these values "checked_value:unchecked_value"
$col["formatter"] = "checkbox";
$cols[] = $col;
You can help me? Thank you
1. You can set onclick event of check and fill the field with jquery code.
$col["editoptions"]["onclick"] = "function(){ … }";
Use firebug or debugger F12, to find the element ID and use jquery code to fill other field.
2. You can test this code by saving it in demos/misc/example-all.php:
http://pastebin.com/2bfbgsTX
In excel mode, when you click a cell, it comes in edit mode. And when either press enter or select other cell, the previous one is saved in db.