aurelia-v-grid / vGrid

Aurelia-v-grid - npm source
MIT License
49 stars 10 forks source link

default datasource #71

Closed vegarringdal closed 7 years ago

vegarringdal commented 7 years ago

Need to add some more defaults here @Thanood, if you have any suggestions that will make it easier for your app, then please add comments

Atm I have setArray, this resets all sorting/grouping etc

Was thinking about adding these:

Thanood commented 7 years ago

Although the data part of my app is really simple (just show data items) I will have a look when I'm back at work. Recently I've tried to introduce a "redux-ish" behaviour to the app which takes a lot of time (it needs "predictable state"). Not sure when that's finished.

One thing about the function names. I think they are a little confusing. Especially the addNew/addToArray pair. How about this (same order as your list)?

Not sure about unshift and push but I'll keep it there for the sake of discussion. 😃

In general I'm not sure if some of these are too "coupled" to the grid (as opposed to the data). For instance addNew() without any arguments manipulates the grid directly, right? If so, it's not manipulating the data which IMO a datasource should be all about.

removeCurrent() is a similar case. I'd probably split that into a getSelectedRow()/removeRow() pair.

vegarringdal commented 7 years ago

thx, like it, Ill have a new look at these when I start adding more. Added the addRows atm, didnt see this before now, and added it to the demo, just to see how it behaves/ see bugs better. No problem changing name, only you that use it so we can break it a lot 😂

addNew would add a empty row in array binded to grid... Im not doing slice when you set array. (maybe I should)

A lot we can do to improve how default datasource works.

vegarringdal commented 7 years ago

These are now added, removed my addRows

All of these need some tuning, a lot more testing, refresh etc uses orderby and grouping, but overlook filter atm, same with push and addBankRow/unshift

vegarringdal commented 7 years ago

Note to my self

vegarringdal commented 7 years ago

added the remove