#apexworld, #apex, #MOCA, #oracleapex, #farooqahmad, #menu, #custommenu, #softwareandwebsite, #ORACLE, #DATABASE, #interactivegrid, #grid , #interactive
How to merge cell / group left in Oracle APEX
$(document).ready(function(){
$('#EMP_REG .t-Report-report').each(function () {
// alert(1);
var dimension_cells = new Array();
var dimension_col = null;
var grand_tot = null;
var i = 1;
// First, scan first row of headers for the "Dimensions" column.
$(this).find('th').each(function () {
// alert($(this).text());
if ($(this).text() == 'Deptno') {
dimension_col = i;
// alert(dimension_col);
}
i++;
});
// first_instance holds the first instance of identical td
var first_instance = null;
var hid_col = null;
var hid_col2 = null;
var hid_col3 = null;
var hid_col8 = null;
// iterate through rows
$(this).find('tr').each(function () {
//alert('find tr');
// find the td of the correct column (determined by the dimension_col set above)
var dimension_td = $(this).find('td:nth-child(' + dimension_col + ')');
var col1 = $(this).find('td:nth-child(' + 0 + ')');
var col2 = $(this).find('td:nth-child(' + 1 + ')');
//var col3 = $(this).find('td:nth-child(' + 3 + ')');
//var col8 = $(this).find('td:nth-child(' + 8 + ')');
// alert(col8.text());
//alert(tot);
if (first_instance == null) {
// must be the first row
first_instance = dimension_td;
hid_col = col1;
hid_col2 = col2;
// hid_col3 = col3;
// hid_col8 = col8.text();
//alert(hid_col8);
} else if (dimension_td.text() == first_instance.text()) {
//alert(dimension_td.text());
// the current td is identical to the previous
// remove the current td
dimension_td.remove();
col1.remove();
col2.remove();
//col3.remove();
dimension_td.text("");
v_first_instance=0;
if(isNaN(first_instance.attr('rowspan')))
{
v_first_instance=1;
}
else
{
v_first_instance=first_instance.attr('rowspan');
}
// increment the rowspan attribute of the first instance
first_instance.attr('rowspan', parseInt(v_first_instance)+ 1);
//hid_col.attr('name', 'f01');
//hid_col.attr('id', 'f01_1');
hid_col.attr('rowspan', parseInt(v_first_instance)+ 1);
hid_col2.attr('rowspan', parseInt(v_first_instance)+ 1);
//hid_col3.attr('rowspan', parseInt(v_first_instance)+ 1);
first_instance.attr("style","border-bottom: 1px solid #e6e6e6;")
hid_col.attr("style","border-bottom: 1px solid #e6e6e6;")
hid_col2.attr("style","border-bottom: 1px solid #e6e6e6;")
// hid_col3.attr("style","border-bottom: 1px solid #e6e6e6;")
} else {
// this cell is different from the last
first_instance = dimension_td;
hid_col = col1;
hid_col2 = col2;
//hid_col3 = col3;
// hid_col8 = col8.text();
//alert(hid_col8)
}
//alert("dimension_td.text()="+dimension_td.text()+"--"+first_instance.text());
});
});
});
Like Comment Share Subscribe And Press The Bill Icon...
[email protected]
/ farooq-ahmad-148521112
+92-344-4256-748