Table Builder

Separate to my above post, how can I move the table editor out from the cogwheel/gear :gear: onto the main editor bar?

3 Likes

6 posts were split to a new topic: How to change the default column names?

Interesting… I believe this is because spreadsheet formulas can be entered using =, though formulas are not supported in the theme component. I will look into this.

The theme component uses the pluginAPI to add the button to the cog wheel menu (see code).

You could similarly use the api to add it directly to the toolbar like so:

  api.onToolbarCreate((toolbar) => {
    toolbar.addButton({
      id: "table-builder",
      group: "extras",
      icon: "table",
      action: "showTableBuilder",
      title: themePrefix("discourse_table_builder.composer.button"),
    });
  });

What do you mean by this? The spreadsheet editor functionality is being used already. It is shown in the modal when you create/edit tables.

3 Likes

Thank you for all the info.

What I mean is, I would be interested in having the full spreadsheet functionality, i.e. the functions that I insert would be evaluated.

Is there a way to modify this plugin to achieve this?

EDIT: to clarify, I would like the inputs of the spreadsheet editor not be be converted into markdown for insertion, but instead that the entire spreadsheet is inserted (and that functions work).

3 Likes

I’m not entirely sure and would need to look into the JSpreadsheet library a bit more, but briefly looking over, it seems that spreadsheet functions/formulas are a premium feature of the library:

You will likely need to purchase a premium license from JSpreadsheet and modifiy the theme component to use the pro version JS scripts for it to work.

3 Likes

Thank you. I didn’t realize it was a premium feature. That sounds like a good solution for me though.

Btw, did you look at x-spreadsheet, it looks pretty cool:

https://myliang.github.io/x-spreadsheet/

3 Likes

Hello,

when I try to install this as a theme component with the given git repo link I encounter an error:

Error creating upload asset: jsuites. Original filename Sorry, the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, woff, woff2, svg, eot, ttf, otf, gif, mp4, webm).

Hi @Buntspecht :slight_smile:

It doesn’t look like you have .js in your authorised extensions:

3 Likes

:mega: I’d like to let everyone who has this theme component installed know that it has now been bundled into core. Please remove the theme component from your Discourse instance after upgrading.

4 Likes

As the functionality of this theme component is now included as a core feature, please create support feature ux bug topics for any issues you encounter or any suggestions you may have.