Comments (8)
@MicroDroid I have tried, but when the tables render there are always some rows out of order.
In my case the first one will always be the row with id 57, but when i click to sort by id everyting fixes up....
I also noticed that the demo image in the documentation has the same error (first one is id 26)
from vue-materialize-datatable.
This should be a good place for improvement.
For now, try ordering the dataset outside the plugin on initial render
from vue-materialize-datatable.
@rodrigoAbril I understand that your question was asked nearly 2 years ago, but here is temporary solution:
in DataTable.vue find sortColumn
data and change it to the column number you want your component to be sorted by on init.
@MicroDroid can we implement some new prop (:initSort=1/2/3/etc for example), which will change initial sorting?
from vue-materialize-datatable.
:) seems like a good solution
from vue-materialize-datatable.
@justice47 I'd rather find a better way since this is a controlled component and I'd rather not use local state with a prop like that.
from vue-materialize-datatable.
@MicroDroid ok, if you will find a better way just post your thoughts about it, I can try to help you with that!
from vue-materialize-datatable.
@MicroDroid maybe this approach will suit all needs:
Lets stay with sortColumn
in data and change it only once, when component is mounted.
Example:
props
props: {
...,
initSortCol: {default: 0}
}
data
data: () => ({
...,
sortColumn: 0,
}
mounted hook
mounted: function() {
...
this.sortColumn = this.initSortCol
}
and then in component call
<datatable
...
:initSortCol="2"
>
from vue-materialize-datatable.
Closed in #42
from vue-materialize-datatable.
Related Issues (20)
- Error in render: "RangeError: invalid array length HOT 4
- Any template with this datatables? HOT 1
- Invalid prop: type check failed for prop "customButtons". Expected Function, got Array HOT 1
- Exported Excel has HTML tags HOT 3
- Browser Use HOT 1
- Using bootstrap HOT 4
- Change table current page HOT 2
- Date filter in column function call HOT 2
- Sortable on a th, td manually defined fields HOT 1
- Pagination, right and left arrows get darker and darker when you click them until you can't see the icons HOT 1
- Column searching, sorting Questions HOT 1
- [Feature] Adding entries HOT 3
- Sorting by Date time Strings HOT 3
- Exporting options for Cyrillic? HOT 4
- If Paginate set to false, printing raise an error : "TypeError: can't access property "remove", clonedTable.querySelector(...) is null"
- Can't Use The Data Table HOT 2
- Datatable Column Render function
- Export table with utf-8 format
- Compatibilidad con vue3 HOT 1
- Responsiveness HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-materialize-datatable.