how do I suppress a column?

26 views
Skip to first unread message

Paul Traina

unread,
Apr 8, 2011, 2:59:17 PM4/8/11
to tabl...@googlegroups.com
Andrew,

One other question... I'm pulling data out of my database with a custom SQL query.  One of the fields I want is a unique ID for a transaction (a telephone call).

I want to be able to have someone click on the date of the call and be sent to a URL that gives more info on that particular call.  I am successfully doing that with transformations:

            "Date" => array(
                "html"          => "{DATA}",
                "tag"           => "a",
                "attrib"        => array("href" => "create?uid={ASSOCIATED}"),
                "associate"     => "Call ID",
            ),

However, I really don't want to ever display the Call ID column.   You've got code for injecting columns of data, is there any trick to suppressing columns of data?
I was thinking maybe a transform on Call ID to assign it a given class and then display:none; that class inside the CSS, but that's kinda evil.  I'd rather just mark that column as no-display to TG.

Paul Traina

unread,
Apr 8, 2011, 8:46:05 PM4/8/11
to TableGear
The way I ended up kludging it was to include the Call ID field
(really uniqueid) and then

"columns" => array("uniqueid" => "hidden");
"headers" => array("uniqueid" => array("html" => "Call ID", "class"
=> "hidden"));

and then appropriate css to take those elements with class hidden and
display:none; them. Ugly, sigh.
Nothing like reading the source code. Very nice idea of using the
hashes of hashes to build your html.

Andrew

unread,
Apr 14, 2011, 8:25:20 AM4/14/11
to TableGear
No, doing it that way is fine...there's no reason to think it's
"ugly".
You should be limiting the data set from the start if you didn't need
the data from that field, but sense you do, hiding it makes sense to
me.

http://andrewplummer.com/code/tablegear/

However I previously hadn't been putting the field name on the TH
header, so it would have been hard to hide the entire column by a
single class name. I've fixed this in 1.6.2, so try downloading
that...it should do what you need.

Andrew
Reply all
Reply to author
Forward
0 new messages