Hello.
I have the next code:
$col = array();
$col["title"] = 'ENVIADO?';
$col["name"] = 'ds_enviado';
$col["width"] = '63';
$col["editable"] = false;
$col["frozen"] = true;
//$col["hidden"] = true;
$cols[] = $col;
(This Column only display 2 values: "S" or "N")
I need put a button in other Column only if the value of the column is "S"
In the Buttom Column i write:
$col["condition"] = $row["ds_id"] == "S";
But not work….
Can help me?
Thanks!
For button column, you can set on_data_display event and in callback check value of row to show button.
e.g.
$col["on_data_display"] = array("display_button","");
function display_button($data)
{
$v = $data["ds_enviado"];
if ($v == "S")
return "<input type='button'>";
else
return "-";
}
Ok, Thanks!
But i use the next code….
$buttons_html_enviar = "<a target='_self' ….'>SOLICITAR</a>";
$buttons_html_ver = "<a target='_self' ….'>VER</a>";
$col["condition"] = array('$row["ds_enviado"] == "S"',$buttons_html_ver,$buttons_html_enviar);
$col["default"] = $buttons_html;
If the HTML of the $buttons_html_ver display a blank value works…
I think my method is not too profesional… but solved the problems
Thanks again a sorry for my english