vue-tables-2 | Vue.js 2 grid components | Grid library
kandi X-RAY | vue-tables-2 Summary
kandi X-RAY | vue-tables-2 Summary
Vue Tables 2 was created to give developers a fully featured tool-set for creating beautiful and useful data tables with Vue.js. Used in hundreds of commercial software applications, Vue Tables 2 is constantly growing, improving and getting new features.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Server - side helper
- Adds events listeners to the screen .
- Test a value against a query
- Get device range
- Find a new module .
- Emit input value updates every row in the input field .
- Gets an array of columns for a given device display .
- Adds editing function to the edit row
- Create a div .
- create random id
vue-tables-2 Key Features
vue-tables-2 Examples and Code Snippets
Community Discussions
Trending Discussions on vue-tables-2
QUESTION
I've inherited someone else's vue code that uses vue-tables-2. The table looks like this (very, very simplified)...
...ANSWER
Answered 2022-Jan-18 at 07:15Is there a way I can use the package but just get the row data without having it wrapped in another "row"
Yes and no. Slot props (anything the component shares with it's slot) is always shared as a singe object. You are the one who gives the variable the name.
So in case of slot="columnZ" slot-scope="row"
(which is by the way a deprecated syntax - current syntax is v-slot:columnZ="row"
)
- You can chose any other name - instead of
row
it can beprops
or anything else - what you get is whole object -
{ row: { keyA: value, keyB: value, etc }, index: 1 }
(assuming)
But you can destructure the object into components - v-slot:columnZ="{ row, index }"
This is same operation as in plain JS:
QUESTION
I'm trying to build tables based off a few selected properties from a previous component: I'm rendering a component called 'branch-comparison' to compare XML files and their properties and values. This component takes in two props:
selectedEnvs: An array of objects with a name and object
commonFiles: An array of files with a name and object
I'm using vue-tables-2 to build these tables. At the top of the template it runs a function called getProps() to generate a set of all possible properties from each file. I've hard coded 0 because currently I'm only letting the user choose 1 file at a time. It then goes through each file (only 1) and gets data for the main table and the comparison tables. They are virtually the same function (getHeadData and getTableData) but I've seperated them for now for further customization. The code is not that important for actually generating the tables, however something inside of them is causing my code to go in an infinite loop.
On the initial render of the component, there is never an infinite loop. Everything runs through, and doesn't break at all and works wonderfully. Once however the component has been rendered, and I make a change to the props, or even simply save the file in the editor and vue-cli hot reloads it, it goes into and infinite loop. All the data still get's generate fine and the component does as it's supposed to. But it loops through 101 times no matter what.
Things I've looked into:
Changing the data: I fully understand a component re renders on data change... however I don't believe I am changing any reactive data in any method call. I'm simply declaring it locally inside the function and returning it to that temporary variable. Also if this was the case, I believe it would go into an infinite loop on the initial component load, but this is not the case. It goes into the infinite loop only on a refresh or prop change.
Mutating the Vuex state: I looked into this but I am never changing the state of anything. I am simply accessing it in the getTableData and getHeadData methods. I then thought, perhaps assigning a variable to point to this state object is causing it to re render based on something accessing the state, so I tried instead of
...ANSWER
Answered 2020-Sep-28 at 13:36I've solved it. The code above is actually fine. Shortly before I posted the code, I was using a computed property in the v-for AND in the getHeadData(), what I think was happening was it was a nested computed property, and on the inner loop it recomputed it and then tried the outer loop again, and so forth. I'm still puzzled why it work on the initial render, but oh well. It is working now.
QUESTION
How do I import sweetalert2 correctly so that I can use Swal? only want to use it in this file. And why doesn't work like on the official site?
ANSWER
Answered 2020-Aug-18 at 17:41Try to not use Vue.use(SweetAlert);
QUESTION
I'm struggling to get a custom filter in vue-tables-2 to emit an event from a nested, single-page component in Vue. The problem may be that I'm not capturing / handling it correctly upstream.
I have a custom filter inside a custom template for
dataTable
which emits Event.$emit("vue-tables.filter::filterByBrand", this.brand)
.
I want to capture this 'filterByBrand' event in a top-level, router component called which is where I have my
plus the attendant options including my
customFilters
.
Any thoughts on where I've gotten off course?
Grid.vue
...ANSWER
Answered 2020-Jul-04 at 13:22import {ClientTable, Event} from 'vue-tables-2';
Vue.use(ClientTable, {}, false, 'bootstrap4');
window.vtEvent = Event; //make new name for vue-table-2 event
QUESTION
Using vue-tables-2 component in my @vue/cli 4.0.5 app I see that GET request generated
...ANSWER
Answered 2020-Apr-17 at 02:10I think you forgot put api
on prefix
QUESTION
Implementing in my @vue/cli 4.0.5 app vue-tables-2 component with server-table and looking at this https://matanya.gitbook.io/vue-tables-2/server-table/custom-request-function
I try to set additive Authorization parameter to request like:
...ANSWER
Answered 2020-Apr-16 at 07:50I managed to run request as:
QUESTION
So I'm using vue tables 2 and found little problem. Let's assume Im getting list of items and they have column called status, each status is constant and now I need to get translated values so making here relation status=key(constant). Table with translated values has color which I'd like to use to fill row.
I see in documentation that there is rowClassCallback, but I'd to return inline style like: background-image: $color (for selected status).
Even in this function (rowClassCallback) I can't check value of color because it's in data.
Here in options rowClassCallback is example what I'd to make.
...ANSWER
Answered 2020-Mar-30 at 14:53You can use similar method named rowAttributesCallback instead of rowClassCallback to pass your arguments to row.
QUESTION
Please help. I have been using Vue Tables 2 for > 2 years now, and I have never had this problem. My table shows up perfectly as usual, but now whenever I click on a cell, it is surrounded by a blue outline on chrome and a dotted outline on firefox. It is exhibiting the same behavior as if I had clicked on an input. I went through my Vue Tables 2 options one by one, disabling each in turn and it did not change the behavior. I looked through bootstrap 4 tables documentation, and could not find the same behavior as a option, so i believe it is vue tables that is doing it. The demo fiddle on the Vue Tables 2 page also has this behavior. It is very distracting and I am trying to get it to stop.
My goal is to have the table show the behavior it has before, which is to do nothing when you click on a cell.
I am using Bootstrap 4.4, and Vue-Tables-2 version 1.6.25
My options array looks like so
...ANSWER
Answered 2020-Feb-17 at 04:12That is the focus selector of CSS whose style is being applied. See here: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus
You need to override this CSS and set border to none.
You can also do this:
QUESTION
I can't figure out why the hiddenColumns
option does not work. When I set it to hiddenColumns:['name']
, I still can see the name
column... I've tried the newest version but the problem remains.
EDIT
I want to have name
column hidden by default but user can unhide it using columnsDropdown
. So I can't just remove it from the columns
array.
ANSWER
Answered 2020-Jan-08 at 11:28if you are using an version older than november 2019 it properly wont work based on matfish2 last post on this GitHub issue. I had the same issue, but using latest version did the trick for me.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-tables-2
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page