css style column along with regular expressoin for email verification

Questionscss style column along with regular expressoin for email verification
Mario asked 8 years ago

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?

1 Answers
Abu Ghufran answered 8 years ago

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) {…}

Your Answer

20 + 13 =

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?