Closed EdLeckert closed 9 months ago
Made one more change to provide a calculated default for a missing name
option, so it doesn't need to be provided and the manual sort will still work.
Wasn't sure about the col_ids
restriction due to having an icon, so removed it. It was undefined
in all of my cases anyway. Let me know if this is a problem.
I really do believe that encouraging the use of a name
option on each column, even if it's not required, is the right thing to do. And the id
column adds a small bit of confusion that I think we could do without in the future, simply by encouraging the use of name
instead.
Thoughts?
lgtm, personally I would not be in favor of requiring name
as this will likely break some existing setups. Apart from that this looks good, merging...
This is a super awesome enhancement. Will this get pushed in a release in the next days or should I just clone master?
@daringer: Any chance of cutting a new release? I'm particularly interested in seeing #105 get released.
yeah, good point, will try to do it today - sry for the delays
@EdLeckert done, testing looks good for me
@daringer Thanks!
Satisfies feature request:
35
After initial sort from config, columns can be sorted ascending/descending by clicking on column header. Order of other columns then becomes indeterminate.
Took the suggestion by @myhomeiot to use
ZHA Network Card
as an example. Code has diverged considerably since the original branch, but with modifications it was quite useful.When sorting via config, the user is responsible for making certain that any
sort_by
columns are configured properly; e.g., if anid
option is required because thedata
option of all columns is identical, then the user must provide anid
option for the sortable columns. However, in the case of column sorting, all visible columns must be sortable without any assistance from the user. For this reason, I have added thename
option as a value that could be used in thesort_by
list. While thename
option is not currently listed as being required by the config for columns, it is probably the most likely to be available consistently. It has been placed last in the list, following such options asid
anddata
.Would it be possible to make
name
a required option for columns going forward? It's a breaking change, but a simple one, and probably won't affect many users. In fact, I don't see why thename
value wouldn't be the preferred way to specify thesort_by
option, essentially rendering theid
field obsolete. It's quite useful if not necessary for naming columns, and should always be unique, I would think. Am I missing something?Anyway, this could use some testing with a wider variety of configurations than I can dream up, but I know of no issues other than a dependency on the
name
option.