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

Problem with Chrome Compatibility for Bootstrap Carousel

My webpage features a carousel implemented as a slider. It seems to be working fine in Firefox and mobile browsers, except for Chrome where it doesn't show up at all. I can't seem to figure out what's causing the issue. Here is the syntax I& ...

Store the numeric value in JavaScript as a PHP integer

My goal is to obtain the width of the browser and then compare it as a PHP variable. However, the issue I am facing is that it is being saved as a string, and my attempts at parsing it to another variable only result in returning 0. $tam='<script& ...

Dynamic jQuery Carousel

Is there a jQuery slider that can adapt to different screen sizes and handle images of varying widths? Appreciate any insights! ...

Issue: Attempting to render objects as React children is invalid. Consider using an array if you want to render a collection of children. This problem often occurs when fetching data from a JSON

Hey everyone, I'm currently working on a small website using ReactJS. After adding the code below, an error keeps popping up: Objects are not valid as a React child. If you meant to render a collection of children, use an array instead. Here's t ...

Refine your search with a JSON object description in expressJS and UnderscoreJS

[ { "id": 1, "description": "Empty the garbage bin", "completed": false }, { "id": 2, "description": "Dine out for dinner", "completed": false }, { "id": 3, "description": "Exercise at the fitness center", "com ...

Refresh the content of a webpage in AngularJS without the need to fully reload the entire page

Within my controller and view files, I have content that is sourced from various places, including API calls. For instance, I have information retrieved from the database where users can update certain details like their last name. After submitting the up ...

What is the best way to select a cell within the same row using jQuery?

I've successfully implemented a table with a single input field and an AJAX script that triggers when the input field value is changed. Everything is functioning as expected. However, I now face the challenge of adding a dynamic date insertion feature ...

Summary in Javascript

After utilizing the inspect code tool in PHPStorm, I received the following message: 'recipient_user.id === app.currentUser.id ? true : false' can be simplified to '!!(recipient_user.id === app.currentUser.id)' I'm wondering: ...

Column Locking with Merged Rows

I have implemented row spanning in jqgrid by following the instructions provided in this answer: Jqgrid - grouping row level data However, I am facing an issue where setting a column with row span to frozen = true causes the overlay to lose the row spanni ...

instructions for creating a hover effect where one div vanishes when hovering over another div

Is there a way to make the line visible when hovering over my circular div? #line { display: none } <div id='circle'> <div id= 'line'> ...

Tips for managing Express.js callbacks and modifying an object's property from within a function

I am currently working with two JavaScript files. I have successfully retrieved data from MongoDB using the method bookDao.getActiveBookByCategoryId(). The Issue I Am Facing: Within the categoryDao.js file, I am attempting to update the resultJson.book_c ...

Best practice for detecting external modifications to an ngModel within a directive

I've been working on creating a directive that can take input from two sources and merge them into one. To achieve this, I'm monitoring changes in both inputs and updating the combined value in the ngModel of my directive. However, there's ...

Vue 3 array error: Additional attributes not designated as props were passed to the component and could not be inherited automatically

Hey there, I'm currently delving into learning VueJS 3 and facing a beginner issue. When I check the browser developer console, I come across this warning message: https://i.stack.imgur.com/5eo6r.png The warning message reads as follows: [Vue warn]: ...

Problem with Jquery hover or mouse enter show/hide functionality

I am currently experimenting with displaying hidden text when the mouse enters a div and hiding it when it leaves. Here is the progress I've made on my JSFiddle: $(document).ready(function() { $(".image").mouseover(function(){ $(".hover").show ...

When using Lockdown.js with NPM, I encounter a blank file being returned

When using Lockdown.js for NPM, I encountered an issue where the command to generate the lockdown file resulted in an empty file. Here are the links for the dependencies: NPM lockdown git Here is a snippet from my package.json: { "name": "nw", "pri ...

Determine the character's position in an input field by tracking mouse movements

I am in need of a way to determine the position of a character in an input field based on mouse movement. For example, if the input field contains the value 'abcde' and I hover my mouse over the character 'a', the position should be ...

What methods can be used to continuously send data to another web page within my website using XMLHttpRequest()?

As I delve into working with node.js and express.js, my primary goal is to efficiently tackle a specific issue. One of the pages on my website is tasked with receiving location data in latitude var lat and longitude var long. The challenge at hand is to c ...

Can a ListItem attribute be generated?

In the realm of Material UI, you can find a detailed showcase of ListItem at http://www.material-ui.com/#/components/list The appearance of a nested ListItem is demonstrated below: <ListItem value={1} primaryText="Brendan Lim" leftAvatar={ ...

Angular 1.4.8 Issue: [$injector:modulerr]

I can't seem to identify the main cause of this error. I consistently see a green underline below the word angular in my javascript file. I'm not sure why. (Using Visual Studio Code) HTML <html ng-app="myapp"> <head> ...

Tips for effectively wrapping Material UI v5 component to ensure the Grow component functions correctly

Being a newcomer to React, I want to apologize in advance for any silly mistakes or inaccuracies that may be present. I have successfully implemented the code for my Blog page: export default function Blog() { const [photos, setPhotos] = useState([]); ...