mt-ag / apex-fancytree-plugin

A region plug-in for Oracle APEX that displays data in a tree structure
MIT License
7 stars 4 forks source link

Update to Table Functionality #3

Closed shaunmauer closed 6 years ago

shaunmauer commented 7 years ago

Hi

Is it possible to choose to not show the table numbering column (the first one) when using the table column. image

mt-ag commented 7 years ago

I'll look into it either tomorrow or in the weekend, but it'll most likely involve you having to change some of the plug-in code. It'll at this point in time not be a simple toggle, since plug-ins can only have up to 25 custom attributes and I'm hitting that limit.

mt-ag commented 7 years ago

Hey, to accomplish this you'll have to do the following (note: exact line numbers may change)

  1. On line 108, remove the line <col width="30px"></col>
  2. On line 112, remove the following: <th>#</th>. Do NOT remove the other code from that line.
  3. On line 265, you'll find the following code: nodeColumnIdx: 1,. Change that value to "0" to have the title render in the first column.
  4. On line 279, you'll find the following code: $tdList.eq(0).text(node.getIndexHier()).addClass("alignRight");. Remove this code, as this code renders the numbers that you want to have removed.
  5. The last step is to change some code on line 281. You'll see the code $tdList.eq(i+1).text(customData[Object.keys(customData)[i-1]]);. Change that to $tdList.eq(i).text(customData[Object.keys(customData)[i-1]]);.

Once you've done this, it should not render the numbers anymore and render the title/value of the row in the first column. If you just want the first column empty, you only have to do step 4.

shaunmauer commented 7 years ago

Hi

I found another way to do this. I just use CSS to hide it.

Replace STATIC_ID with the static ID of the tree in Apex.

Hide the header and the actual numbers

#treeSTATIC_ID >thead th:nth-child(1), #treeSTATIC_ID >tbody td:nth-child(1) {
    display: none;
}

Only problem with this is the column widths arent the right size afterwards, so I need to adjust the size(which I wanted to do anyway)


#treeSTATIC_ID >thead th:nth-child(2) {
    width:350px;
}