Hello,
How may I combine your css-styling feature…
———-
$f = array();
$f["column"] = "customers_email";
$f["op"] = "=";
$f["value"] = "HOW TO INTEGRATE REGULAREXPRESSION HERE";
// $f["value"] = "^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9._-]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$";
$f["cellcss"] = "'background-color':'red'";
$f_conditions[] = $f;
.. with a regular expression for checking emailsyntax.
I want to highlight wrong email-syntax. I could integrate the regular expression in
the value-field, but since my syntax-check is strong I like to ask, if one may match the css-filter also with a kind of checking-colum?
——–
The reason I like to join with a second "control-column", is, that the select is quite big:
———
select c.customers_id, c.customers_lastname, c.customers_telephone, c.customers_email_address, nl.customers_email_address, o.customers_email_address FROM
(SELECT customers_id, customers_lastname, customers_telephone, customers_email_address FROM `customers` WHERE `customers_email_address` NOT REGEXP '^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9].[a-zA-Z]{2,4}$'
union ALL
SELECT customers_id, customers_lastname, customers_telephone, customers_email_address FROM `customers` WHERE `customers_email_address` NOT REGEXP '^[a-zA-Z0-9][a-zA-Z0-9._-]*@[a-zA-Z0-9][a-zA-Z0-9._-]*\.[a-zA-Z]{2,4}$'
union ALL
union ALL
SELECT customers_id, customers_lastname, customers_telephone, customers_email_address FROM `customers` WHERE `customers_email_address` NOT REGEXP '^[^@]+@[^@]+.[^@]{2,}$'
union ALL
SELECT customers_id, customers_lastname, customers_telephone, customers_email_address FROM `customers` WHERE `customers_email_address` NOT REGEXP '^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9._-]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$'
group by customers_id
) c
left join newsletter_recipients nl on nl.customers_id = c.customers_id
left join orders o on o.customers_id = c.customers_id
group by c.customers_id
————-
Thus, is it possible to highlight the "real column", if the email-checking-column matches the filter?
You can review custom-format-ext.php demo which uses JS code for formatting rows/columns.
Code: http://phpgrid.org/demo/demos/appearance/conditional-format-ext.phps
Demo: http://phpgrid.org/demo/demos/appearance/conditional-format-ext.php
Main part is in this code:
function grid_onload(ids) {…}