Selections made within bottom columns in DevExtreme's DxDataGrid do not activate click events

Check out the code snippet below:

<template>
    <div>
        <DxDataGrid :dataSource="viewerRoles">
            <DxColumn data-field="name"
                      caption="Ansicht" />
            <DxColumn data-field="description"
                      caption="Beschreibung" />
            <DxColumn type="buttons">
                <DxButton icon="preferences"
                          @click="test" />
            </DxColumn>
        </DxDataGrid>
        <button @click="test"></button>
    </div>
</template>

<script>
    import { DxDataGrid, DxColumn, DxButton } from 'devextreme-vue/data-grid'

    export default {
        name: 'Test',
        components: {
            DxDataGrid, DxColumn, DxButton
        },
        data() {
            return {
                viewerRoles: []
            }
        },
        async created() {
            const svcResp = await this.$http.get('Settings/ViewerRoles');

            if (svcResp.status === 200)
                this.viewerRoles = svcResp.data;
        },
        methods: {
            test() { alert('') }
        }
    }
</script>

Upon testing the buttons in the code, it appears that when clicking the HTML <button>, the browser successfully triggers the alert. However, when clicking the <DxButton>, no response is seen. Surprisingly, no errors are reported in the console during debugging.

If you have any ideas on what might be causing this issue, please let me know!

Answer №1

To update the event handler for DxButton, change @click to :on-click. Your modified code should look something like this:

<DxColumn type="buttons">
  <DxButton icon="preferences"
            :on-click="test" />
</DxColumn>

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

The VueTool Tip feature is not functional within a modal window

I've integrated Vue ToolTip into my project and it's working flawlessly on the main page. However, when I tried to implement it on a modal pop-up page, it doesn't seem to work as expected. To better illustrate the issue, I've set up a ...

JavaScript object-oriented programming constructor sets data using AJAX - a feature not found in the prototype

Having an issue with implementing a JavaScript class where the constructor is populated through an AJAX call. The data is fetched from a file and correctly fills the class properties asynchronously. Below is the current code: function Pattern(file){ ...

Having trouble getting HTML to render properly in React JS on localhost using Apache server

For the past week, I've been working on resolving an issue. I started by creating a React Application using: npm create react-app After that, I attempted to build it with: npm run build Everything seemed to go smoothly. I generated a build folder ...

The process of querying two MySQL tables simultaneously in a Node.js environment using Express

My goal is to display both the article and comments when a user clicks on a post. However, I've encountered an issue where only the post loads without the accompanying comments. Here is the code snippet that I've been working with: router.get(&a ...

How to hide an ASP.net panel with JavaScript

I am working on a radioButtonList that contains two items: one with a value of "Yes" and the other with a value of "No." Below the radioButtonList, I have a panel that I would like to show when the "Yes" radiobutton is selected, and hide when the "No" rad ...

"Make a phone call following the completion of an HTTP

Upon receiving and storing data, I am looking to execute a function but the code I currently have is not producing the desired result. Could someone provide some insight into what I might be doing incorrectly? Here's my current code snippet: $h ...

Utilizing Nested Partials and Accessing Object References in AngularJS

I am facing an issue with a partial view that appears like this: <div ng-if="activeItem.typeOf == 'text'"> <div onload="item=activeItem" ng-include="'views/app-builder/text.html'"></div> </div> Whenever a ...

Establishing a maximum number of checkboxes that can be selected

I've browsed through similar questions here and attempted to replicate them, but I'm struggling to identify my mistake. All I want is for only one checkbox to be checked. I've set the limit using limitCal and I'm checking the siblings. ...

looping through an array to extract values

i have: var myVariable= { var_one: ["satu", 'uno'], var_two: ["dua", 'dos'], var_three: ["tiga", 'tres'], var_four: ["empat", 'cuatro'], var_five: ["lima", 'cinco'], var_six: ["enam ...

Tips for creating a sophisticated JavaScript polling system

In order to meet my requirement, I am looking for a JavaScript function that can continuously poll the database via AJAX to check for a specific status. When the status is "active," I want an alert to notify me that the case is now active. The JavaScript s ...

What is the process for deleting headers in a $http.get call and simultaneously including "application/json" and "text/plain" under the "Accept" header?

I'm relatively new to angularjs and I'm currently working on implementing some new features to an existing Angular JS application. The current API calls are quite intricate so I decided to make a direct call. Below is the code snippet for my new ...

Utilize an asynchronous method to upload files to Google Cloud Storage in a loop

I am new to using Javascript and have been working on a loop to upload images to Google Cloud Storage. While the image uploads correctly with this code, I'm facing an issue where the path (URL) is not being saved in the database AFTER the upload. I a ...

Is this preloader code actually preloading something?

Struggling to add a preloader on my website. I came across the following code that appears to be functioning (I can see the CSS animation before the images load - check out this JSFiddle). However, I'm unsure about how the JS code actually operates... ...

Guide to setting up and launching a JavaScript/Vue GitHub repository on your local machine

I have a cloned app located here: cvss-v4-calculator that I want to run locally for debugging with VS Code or a similar tool. However, I'm encountering difficulties in setting it up. I've been attempting to run this as a web page using node.js, b ...

What is the method for pulling information from MySQL and presenting it on a website using Node.js?

Currently, my goal is to retrieve data from MySQL and showcase it on my HTML page. The code snippet in server.js looks like this: const path = require('path'); const express = require('express'); const bodyParser = require("body-pa ...

Is it possible to change the browser language for specific tests in Cypress?

As part of my CI testing, I am tasked with proving that the page will correctly display in French when a user has a French browser, and fallback to English if no French translation is available. The site utilizes Quasar and i18n for language support, whic ...

A cautionary message about the React / TypeScript serviceWorker Update function and steps to troubleshoot

Whenever I attempt to run npm run build, an error pops up that says: Failed to compile. src/serviceWorker.js Line 38:36: Array.prototype.map() expects a value to be returned at the end of arrow function array-callback-return // Update a service work ...

JavaScript function failing to assign a value

I am currently working on a function that is responsible for detecting the selected item in a dropdown list and then making changes to a form accordingly. This can involve hiding certain form fields or updating the value of a field. While the hiding and ...

Sending data with React using POST request

Currently in my React application, I have a form that includes fields for username and password (with plans to add "confirm password" as well). When submitting the form, I need it to send JSON data containing the email and password in its body. The passwo ...

JavaScript Divide Array

I am currently tackling the challenge of creating a custom string splitter function, and I must say, it's proving to be more complex than anticipated. Essentially, the function takes in a string and an array of delimiter values that the string will b ...