Closed xPlux closed 5 years ago
So, if you allow to pass fields only as object then I can't declare array like this:
fields: [{name: 'foo', label: 'Foo'}]
and i have to do this:
fields: {'foo': {label: 'Foo'}}
but in this case name parameter is unnecessary and line 158 in VdtnetTable.vue
field.name = field.name || k
does not make sense. Yes, I can overwrite name but why?
Yes. To give several examples of using array in this patch that may cause downstream issues:
Explain: https://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-a-bad-idea
name
is not required but it is required in my component. Why is that? I'm using name
here: I know in jQuery Datatables, you can define columns as [{columnDef1}, null, null, {columnDef2}, null]. If user start to pass this in, we have to handle null
. How will we handle defaults? Will these null columns be handle on the server-side? isLocal, sortable, searchable...
Sorry, don't take it the hard way as I don't mean to be offensive. I just want to discuss this a little more. It's all part of code review. I'm suggesting that maybe this pull request is not complete? It need to provide strategy, at a minimum, to handle the situations I for-see above and have unit tests to prove?
For example, if name is not provided, it will default to using 'column-[1-n]' for slot name.
I prefer not to use array as it may introduce unnecessary complexity.