Skip to Content Skip to Menu

CB User list formatted as a table

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 644
  • Thanks: 43
  • Karma: 4
1 month 2 weeks ago #344343 by rbuelund
CB User list formatted as a table was created by rbuelund
I once got a description her in the forum on how to convert a user list (frontend) to a table layout with an auto action. It used to work, but not anymore ?? I used this javascript in the auto action that is fired on the list - it just guves a blank page:

document.addEventListener("DOMContentLoaded", () => {
var body=document.body,
    parent=body.querySelector("#cbUserTable"),
    rows=parent.querySelectorAll(".cbUserListRow"),
    table=document.createElement("table"),
    tbody=document.createElement("tbody"),
    row=document.createElement("tr"),
    cell=document.createElement("td"),
    x=rows.length,
    cells=rows[0].querySelectorAll(".cbUserListRowColumn"),
    y=cells.length,
    i,j;
table.appendChild(tbody)
for(i=0;i<x;i++){
    row=row.cloneNode(0);
    cells=rows.querySelectorAll(".cbUserListRowColumn");
    y=cells.length;
    for(j=0;j<y;j++){
        cell=cell.cloneNode(0);
        cell.innerHTML=cells[j].innerHTML;
        row.appendChild(cell);
    }
    tbody.appendChild(row);
}
body.appendChild(table);
const element = document.getElementById("cbUserTable");
element.remove(); 
});

 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50693
  • Thanks: 8690
  • Karma: 1475
1 month 2 weeks ago #344346 by krileon
Replied by krileon on topic CB User list formatted as a table
Why are you needing to do this? The div structure has all the appropriate roles set.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 644
  • Thanks: 43
  • Karma: 4
1 month 2 weeks ago #344349 by rbuelund
Replied by rbuelund on topic CB User list formatted as a table
I need to be able to copy all the data directly into an Excel sheet, so that it keeps the columns

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50693
  • Thanks: 8690
  • Karma: 1475
1 month 1 week ago #344354 by krileon
Replied by krileon on topic CB User list formatted as a table
Is that for administrative purposes or for general user use? If it's for administrative purposes I strongly recommend just using the Export feature in CB > User Management.

As for your code itself I can't really help you with that. You'd just need to be using a Code action on the onBeforeDisplayUsersList trigger and you can output custom code on the userlist page.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 644
  • Thanks: 43
  • Karma: 4
1 month 1 week ago #344355 by rbuelund
Replied by rbuelund on topic CB User list formatted as a table
I would just like to be able to select which fields I download in the CSV - is that possible in backend. Otherwise i have to use time on deleting a lot of columns afterwards.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50693
  • Thanks: 8690
  • Karma: 1475
1 month 1 week ago #344357 by krileon
Replied by krileon on topic CB User list formatted as a table
Currently no that's not possible. Have added a feature ticket as I've maybe an idea of how to go about adding that relatively easily.

forge.joomlapolis.com/issues/9912


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum