fiogf49gjkf0d Steve,
It is possible.
I'll give an example using the templates searchcondata and the query con_con and hiding the workphone column because I happened to have done an example on it for something else.
First, copy the query "con_con" and open it. Note that on the layout tab/Table Properties there's an ID on the table called CONRESULTS. While the table properties is selected, click on the "ONRENDERCOMPLETE" and in the value box, modify the value so it reads:
"setTarget();myfunction();"
Basically, add the ";myfunction();" to what's already there. That will call the function myfunction after it calls setTarget which fires when rendering is complete for the grid. Now, while you still have the table selected in the drop down that says "Select table component to modify", click in the markup box and type "WORKPHONECOL", add the value of "2" and click "Set". This is the zero-based index of the column to hide - in this case, column 2.
(The reason you have to put it there is so that it's not hard-coded to column 2 in the javascript on the page itself - if the column ever changes, you'll have to change that property. Originally, I used to put an "ID" with a column name in the markup/value pair for the column and search until I found that column. The problem was that unless you have a result row, you couldn't find the ID - the web DLL doesn't put that markup on the table header row. So, at least this way, the javascript isn't hard-coded with a column number, it's a part of the query object.)
Next, copy, activate and open the template "searchcondata". Inside the JavaScript area, add this function:
function myfunction(){ var grid = document.all.CONRESULTS; for (row=0; row<=grid.rows.length-1; row++) { // The commented line below will delete. The two below that that // are uncommented will just hide it. //grid.rows[row].deleteCell(grid.WORKPHONECOL); grid.rows[row].cells[grid.WORKPHONECOL].style.display = "none"; grid.rows[row].cells[grid.WORKPHONECOL].style.visibility = "hidden"; } }
Shutdown, flush, and test. That should do it.
Basically you have to: 1) Put the column name/number in a markup/value on the query object 2) Add a call to a custom function on the query object in the ONRENDERCOMPLETE method 3) Add the custom function to the page the query object is on
Let me know if this helps you out or you have more questions!
Jeff |