Conditional Formating with bigger or smaller as value

QuestionsConditional Formating with bigger or smaller as value
Mario asked 9 years ago

Hi,

is it possible using Conditional Formating with a bigger or smaller as value linke < or >
I want to filter values smaller than 0 (for a stock-management)

What is working like:

f["op"] = "cn";
f["value"] = "-";

best regards,
MArio

3 Answers
Abu Ghufran answered 9 years ago

Refer demos/appear/conditional-format.php

$f = array();
$f["column"] = "id";
$f["op"] = ">";
$f["value"] = "12";
$f["cellcss"] = "'background-color':'red'";
$f_conditions[] = $f;

Mario answered 9 years ago

Hallo

is it possible to set a css-value (not on database) like

$f = array();
$f["column"] = "name";
$f["op"] = "cn";
$f["value"] = "f";
$f["css"] = "'before':'Dear Mrs.'";
$f_conditions[] = $f;

$f = array();
$f["column"] = "name";
$f["op"] = "cn";
$f["value"] = "m";
$f["css"] = "'before':'Dear Mr.'";
$f_conditions[] = $f;

… or is there another way to do this. It should not be set in database, its only for makeing the grid better readable.

Best regards,
Mario

Abu Ghufran answered 9 years ago

You can append string using on_render event handler (in php).
Refer demos/editing/custom-events.php

It would be something like:
function filter_display($data)
{
foreach($data["params"] as &$d)
{
if (strstr("m",$d["name"]))
$d["name"] = "Dear Mr.".$d["name"];
else if (strstr("f",$d["name"]))
$d["name"] = "Dear Mrs.".$d["name"];
}
}

Your Answer

19 + 6 =

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?