Reputation: 541
I have the following report structure which shows sales targets and sales for products throughout the year.
Each product will have two rows: a row showing sales and a row showing sales_target. Currently my report has an edit link next to every line on the report. Is there a way to remove the edit link from the sales_target rows?
select 'red ball'"Product",'sales'"type",'1'"jan",'11'"feb",'31'"mar",'41'"apr",'61'"may",'15'"jun",'15'"jul",'1'"aug",'1'"sep",'21'"oct",'14'"nov",'61'"dec",'Edit' "Edit record" from dual
I thought i code write somewhere a condition on the column to only show the 'edit' link on the row if the sales type is sales and not sales_target?
Any ideas? Thank you.
Upvotes: 1
Views: 9998
Reputation: 346
Usally i use something like this:
In "Edit Column" -> "Column Link" -> "Link Attributes" add the folowing string:
class="#TYPE#"
Add this css style to your page:
.sales_target { display: none; }
Your link will look like:
<a href="#" class="sales_target">sales_target_edit</a>
or
<a href="#" class="sales">sales_edit</a>
All links with class="sales_target" will hide.
Upvotes: 3
Reputation: 7028
Setting the condition on a column will cause the column to be either displayed or not for the whole column, not for a specific row.
One possible solution might be to remove the extra column link through javascript. Run this code in a dynamic action, after refresh of the report. Execute javascript, execute on page load checked. I gave my report region a static id, which is "rStatic" in the code.
$("#report_rStatic .report-standard td[headers='TYPE']").each(function(){
if($(this).text()=='SALES'){
$(this).closest('tr').find("td[headers='EDIT_RECORD'] a").remove();
};
});
This will loop over all cells in the TYPE
column, and when the type is SALES
it will remove the anchor tag in the EDIT_RECORD
column.
Upvotes: 1