|
phpMyEdit - Viewing Bug Advanced Details |
[ Go Back ]
|
|
|
ID:
|
Category:
|
Severity:
|
Reproducibility:
|
Date Submitted:
|
Last Update:
|
|
157 |
core / general |
feature |
always |
2004-01-02 09:06 |
2009-12-22 12:42 |
|
|
Reporter:
|
hbernard |
Platform:
|
PC |
|
|
Assigned To:
|
|
OS:
|
(Server) Linux Mandrake 9.1 |
|
|
Priority:
|
normal |
Version:
|
Builtin |
|
|
Status:
|
feedback |
Product Version:
|
|
|
|
Product Build:
|
|
Resolution:
|
open |
|
|
Projection:
|
none |
Duplicate ID:
|
|
|
|
ETA:
|
none |
|
|
|
Summary:
|
conditionnal row and cell css handling |
|
Description:
|
What if we want a special css for specifics line, depending of the row values ?
A good example is the bug tracker, which display records differently, depending of the state of the bug. |
|
Steps To Reproduce:
|
|
|
Additional Information / Solution:
|
There was a draft implementation in the #121 uploaded patches, but this need more thought, especially about API. |
|
System Description:
|
|
|
Attached Files:
|
|
|
Bug Notes |
|
|
hbernard
|
|
2004-01-02 09:24
|
|
Nepto, you say you have some idea about this.
It would be nice if we could set css style via sql AND/OR php functions.
NB: post 5.4 issue, I think
edited on: 2004-01-02 10:37 |
|
|
|
|
the easiest way is see it is that 'php' would return either $value or array('value' => $value, 'cell_css' => $cell_css, 'row_css' => $row_css);
that would mean also new $css_row.
emulation via sql. 'sql' = 'CONCAT...some sql'; function for 'php' $ret[cell_css] = $value; return $ret; plus U/H/.. flag.
or some new option to use a built in 'php'.
what do you think ? |
|
|
|
hbernard
|
|
2004-01-16 23:21
|
|
well, as said elsewhere, I don't wish to add another $row_* ;-)
I was thinking :
1- idealy allowing to set
$opts['css']['cond-row']['sql'] = (...)
or
$opts['css']['cond-row']['php'] = (...)
where (...) is processed for each row and must return either
- the class name
- null, which means pme must use the default class name
2- another API was proposed in the 'sqlw' thread
see the #121 for more.
the idea is to have a pure virtual field feature (field that don't exist in the table model), use 'php' or 'sql' option to compute its value and to set :
$opts['css']['cond-row'] = "mycustomvirtualfield";
edited on: 2004-01-16 23:22 |
|
|
|
|
current css names are as follows
{prefix}-{class name}-{even/odd}-{fdd_postfix}
where prefix is currently pme
class name is cell/key/value/(row)
even/odd is 0 or 1 (or 2,..)
fdd_postfix is defined in $opts (not dynamic)
we want to add two postfixes:
row_postfix is applied to every cell in that row (eg bug tracker)
cell_postfix is applied just to mentioned cell (eg red if negative)
what the order should be ?
is it possible to make row_postfix a substitute of even/odd ? (use row_postfix if set, use even/odd otherwise)
so i would vote for:
{prefix}-{class name}-{even/odd/row_postfix}-{fdd_postfix}-{cell_postfix}
another question is whether to set whole class or just postfix(es). i vote for postfixes.
and the least important question is how this css should be set, sql or php or both (preferably). |
|
|
|
hbernard
|
|
2004-02-23 18:14
|
|
0. Ok for order
1. I certainly vote for whole class setting.
2. of course both. (sql and php). But again, my question is, which API.
Nepto, you seemed to have some thought, can you tell us the right way ? |
|
|
|
|
The trick mentionned in http://platon.sk/forum/projects/viewtopic.php?t=383
combining $opts['css']['divider'] = 10000; with some hidden 'sql' css look kind of complicated...
Finally did someone came up with something applying to a whole row depending on on of its values? |
|
|
|
pilavdzic
|
|
2005-01-19 22:49
|
|
|
I am also encountering the need to set some rows colored depending on if a certain field (that I would like to be hidden and not show up) contains a 0 or 1. Bug 211 pointed me here, here pointed me to the topic 383 that shows the trick of using the SQL option to conditionally apply style to a cell. That looks good to me, I will try it out now. Is there anyhting else I should try if that doesn't work? I don't understand the divider=10000 trick at all... |
|
|
|
amvarani
|
|
2009-12-22 12:42
|
|
Hi!
Now is almost 2010, and, does anybody have the solution ? |
|