This discussion is archived
4 Replies Latest reply: May 3, 2013 8:39 AM by user1007 RSS

How to distiguish grid view from single row view?

user1007 Newbie
Currently Being Moderated
Customers want a field to be formatted differently in grid view and single row view of IR.
I did this by substituting single view page with totally custom page that looks like single view.
Is there a better solution?
What I was thinking of could be to detect clicking on single row view link (it has
 <a href="#" onclick="gReport.controls.row(rowid?){code} so I could modify it with jquery selector and substitute dynamically so that it sets a value of some hidden item (flag) first and then implement gReport.controls
But may be there is another way to detect if current page is in grid view or in single row view, like, using some built-in variables?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  • 1. Re: How to distiguish grid view from single row view?
    fac586 Guru
    Currently Being Moderated
    user1007 wrote:
    Customers want a field to be formatted differently in grid view and single row view of IR.
    What is a "field"? How is it to be "formatted differently"?
    I did this by substituting single view page with totally custom page that looks like single view.
    Is there a better solution?
    Almost certainly.
    What I was thinking of could be to detect clicking on single row view link (it has
     &lt;a href="#" onclick="gReport.controls.row(rowid?){code} so I could modify it with jquery selector and substitute dynamically so that it sets a value of some hidden item (flag) first and then implement gReport.controls
    But may be there is another way to detect if current page is in grid view or in single row view, like, using some built-in variables?
    You'd be looking to make use of the <tt>apex_detail</tt>/<tt>apex_report</tt> and/or <tt>apexir_DETAIL</tt>/<tt>apexir_REPORT</tt> class and ID attributes and the <tt>display</tt> style of the corresponding elements.

    -----

    You'll get a faster, more effective response to your questions by including as much relevant information as possible upfront. This should include:

    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
  • 2. Re: How to distiguish grid view from single row view?
    user1007 Newbie
    Currently Being Moderated
    'field' obviously means IR column.
    My question is - how to find programatically if IR is in grid mode or in single row view mode.
    Say, I need to show one field and hide another in grid view, and switch to opposite in single row view.

    Well, after a while I came to conclusion: not feasible. The best way would be not to use that 'single row view' and create a separate page with classic report, vertical template, max.rows=1.

    Edited by: user1007 on Apr 29, 2013 10:20 AM
  • 3. Re: How to distiguish grid view from single row view?
    fac586 Guru
    Currently Being Moderated
    user1007 wrote:
    'field' obviously means IR column.
    My question is - how to find programatically if IR is in grid mode or in single row view mode.
    Say, I need to show one field and hide another in grid view, and switch to opposite in single row view.

    Well, after a while I came to conclusion: not feasible. The best way would be not to use that 'single row view' and create a separate page with classic report, vertical template, max.rows=1.
    After a while I've come to the conclusion that too many XY questions are asked on this forum. Explain what the problem is rather than how you are trying to solve it.

    What has to be formatted?

    What formats are required?

    Which format is required in which view?

    APEX version information and a sample report demonstrating the problem on apex.oracle.com would be helpful in finding a solution.
  • 4. Re: How to distiguish grid view from single row view?
    user1007 Newbie
    Currently Being Moderated
    This question was about quite common problem and does not need endless unrelated details.
    I know it has nothing to do with APEX version, required formatting type etc etc, so in spite of your advice I don't want to waste anybody's time by making them to go through particular requirements.
    I admit I should've made a question more generic, f.e. "how to recognize and customize single record report view".
    Now I can give the correct answer:
    try to avoid using single row report view feature if the goal is to customize that view in any way. Single row view is practically impossible to recognize programmatically, and it is as well very hard to customize.
    The correct approach would be to emulate single row view either with read-only form or with classic vertical report.
    Detail view report also might be an option in some cases, but not in my particular situation, because the report I am working on is of 'matrix' type and is rendered from the query string provided by stored function.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points