Vue Dynamic Table Title

Is it possible to add labels to a pivot-table in Vue without affecting array indexes and drag-and-drop functionality as shown in the screenshot below?

https://i.stack.imgur.com/5JTSM.png

Are there alternative methods for implementing this feature?

You can find the JSFiddle here

<script src=//unpkg.com/vue></script>
<script src=//unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7c1c2d29ac7dec1d8c3c3d6d5dbd2f7879984998185">[email protected]</a>/dist/vue-pivottable.umd.js></script>
<link rel="stylesheet" href="//unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2b4b7a7efb2abb4adb6b6a3a0aea782f2ecf1ecf4f0">[email protected]</a>/dist/vue-pivottable.css">
<div id="app">
        <vue-pivottable-ui
            :data="pivotData"
            :aggregator-name="aggregatorName"
            :renderer-name="rendererName"
            :rows="rows"
            :cols="cols"
            :vals="vals"
            :row-total="true"
            :col-total="true"
        >
        </vue-pivottable-ui>
</div>
window.Vue.use(window['vue-pivottable'])
new Vue({
  el: "#app",
  data: {
      pivotData: [
  ['Total Bill', 'Tip', 'Payer Gender', 'Payer Smoker', 'Day of Week', 'Meal', 'Party Size'],
  [16.99, 1.01, 'Female', 'Non-Smoker', 'Sunday', 'Dinner', 2],
  [10.34, 1.66, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 3],
  [21.01, 3.5, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 3],
  [23.68, 3.31, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 2],
  [24.59, 3.61, 'Female', 'Non-Smoker', 'Sunday', 'Dinner', 4],
  [25.29, 4.71, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 4],
  [8.77, 2, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 2],
  [26.88, 3.12, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 4],
  [15.04, 1.96, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 2],
  [14.78, 3.23, 'Male', 'Non-Smoker', 'Sunday', 'Dinner', 2],
],
      aggregatorName: 'Sum',
      rendererName: 'Table Heatmap',
      rows: ['Payer Gender'],
      cols: ['Party Size'],
      vals: ['Total Bill'],
  },
  mounted() {
    const pvtUnused = document.getElementsByClassName(
      'pvtAxisContainer pvtUnused pvtHorizList'
    )
    const pvtCols = document.getElementsByClassName(
      'pvtAxisContainer pvtHorizList pvtCols'
    )
    const pvtRows = document.getElementsByClassName(
      'pvtAxisContainer pvtVertList pvtRows'
    )
    if (pvtUnused.length !== 0) {
      pvtUnused[0].insertAdjacentHTML('afterbegin', '<h4>Unused Data</h4>')
    }
    if (pvtCols.length !== 0) {
      pvtCols[0].insertAdjacentHTML('afterbegin', '<h4>Column Data</h4>')
    }
    if (pvtRows.length !== 0) {
      pvtRows[0].insertAdjacentHTML('afterbegin', '<h4>Row Data</h4>')
    }
  },
})

Answer №1

Based on my understanding of the information provided, it appears that there are specific slots available such as rendererCell, AggregatorCell, colGroup, and output. However, none of these seem to cater to your specific needs.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Creating an asynchronous function in Node.js that returns a promise, but experiencing unexpected behavior when using console.log to display the result

Recently, I created a simple and compact API that determines the gender of a person. It functions by sending a get-request to a specific page which responds with a JSON object. This snippet illustrates how my module works: 'use strict'; const ht ...

Errors in Compiling Dependencies for d3.js Using Typescript

Currently, I am in the process of developing a web application utilizing Node.js alongside Angular, Typescript, and d3.js, among other technologies. The application is functioning properly with library features working as expected. However, I am encounteri ...

Having trouble getting Calendly Webhooks to function in a node.js environment with ngrok?

Hello everyone, this is my first time seeking help on Stack Overflow so please bear with me if there are any flaws in my question. I recently started using the Calendly Teams version and decided to implement the Webhooks feature on a Node.js web applicati ...

Is there a way to transmit React code using Express?

Currently, I'm in the process of creating a coloring demonstration. Initially, I had an SVG file at hand, but I made the decision to utilize svgr for its conversion into a React component. This strategy will offer me the flexibility to easily modify i ...

Looking to divide a multiple-page .TIFF document into several PNG or JPG files using the sharp module in node.js?

Is there a way to split a single .tiff file with multiple pages into several .png or .jpg files without using ImageMagick or GraphicsMagick due to limitations in my codebase? I am unable to install CLI tools so I'm exploring alternate solutions. I kn ...

The methodology of executing a Javascript function

I have the following code snippet: (function() { $(document).ready(function() { //Event handlers $('.project-delete').on('click', function() { deleteProject($(this)); }); $('.keyword-delete').on(&ap ...

Challenge encountered when converting React function component into a class component

I've developed a react functional component that aids in supporting authentication required routes with react-router. const PrivateRoute = ({ component: Component, ...rest }) => ( <Route {...rest} render={props => ( isAuthenticated() ? ...

The People and Groups selection dialog is displaying incorrectly in IE 10

I've been working on a Sharepoint web application and have created a site column of type “People or Group”. This should be automatically associated with a user selection dialog as shown below: However, as you can see in the image above, the users ...

If there are multiple instances of the component, it may not function properly

I have implemented a Vue component as shown below: <script setup lang="ts"> import { PropType } from "nuxt/dist/app/compat/capi"; interface Star { id: string; value: number; } const stars: Star[] = [ { id: &qu ...

Error: Unable to retrieve the "error" property as the data is not defined

Encountered a title error and struggling to fix it :(. Attempting to retrieve data from a signup page, here is the snippet of my JavaScript code: const SignupComponent = () => { const [values, setValues] = useState({ name: 'ryan', emai ...

Create a basic chart using JavaScript

I am looking to replicate a specific chart using JavaScript. The red point in the chart is variable. So far, I have attempted to create it using the flot library: var d3 = [[7,7]]; $.plot("#placeholder", [{ data: d3, points: { show: true } }], { ...

You are unable to move the image to the top of the screen after zooming it with CSS

I implemented an image viewer component with interactive buttons for rotating, zooming in, and zooming out. Upon clicking a button, CSS transform is applied to the image. However, I encountered an issue where, when zooming the image, it cannot be scrolled ...

How can I increase the element by $100 using a dropdown selection in JavaScript?

Hey there! Looking to create a dropdown list with two shipping options: Special Shipping Normal Shipping <select> <option>Special Shipping</option> <option>Normal Shipping</option> </select> If the user selects Speci ...

How to deactivate the <a> tag with Ant Design UI Library

Is there a method in the antd UI library to disable a link? The disabled attribute is not supported by the a tag according to MDN. This code snippet works in React but the link remains clickable when using Next.js. <Tooltip title={tooltip}> <a ...

Populating a dropdown with a list by utilizing the append grid library

Hey there! I'm currently using the jquery appendGrid plugin to display a drop-down menu in one of the columns. In the code snippet below, the column labeled "Origin" has a drop-down option that is working as expected. $(function () { // Initializ ...

Is there a way to automatically advance to the next question in Surveyjs without needing to click the Continue

I'm currently integrating SurveyJs into my web application. The first 3 pages of my survey contain HTML elements that I would like to automatically slide after a few seconds, similar to the functionality on the following sample site using SurveyJS: O ...

Building a custom DSL expression parser and rule engine

In the process of developing an app, I have included a unique feature that involves embedding expressions/rules within a configuration yaml file. For instance, users will be able to reference a variable defined in the yaml file using ${variables.name == &a ...

Arrow function utilized in string rendered component

Hello everyone, I could use some help with the following code snippet: rowRenderer = (e) => { debugger; return e.data?.fileName ? '<a class="documentLink" onclick={() => \'' + console.log('\ ...

The element 'stripe-pricing-table' is not a recognized property of the 'JSX.IntrinsicElements' type

I am currently trying to incorporate a pricing table using information from the Stripe documentation found at this link. However, during the process, I encountered an issue stating: "Property 'stripe-pricing-table' does not exist on type &ap ...

Send the Post model along with 2 checkbox lists to the controller using Jquery's Ajax function

How can I efficiently send 2 lists containing values of checked checkboxes along with my model using JQuery Ajax from an EditorTemplate used as a partial view? Here's the code snippet: @model EsdpExport.View_Models.ProductLineCreateViewModel @using E ...