KingTable icon indicating copy to clipboard operation
KingTable copied to clipboard

Column Order based on query, not alphabetical

Open jschappet opened this issue 6 years ago • 1 comments

Is it possible to have the Column order match the order in the JSON, instead of alphabetical?

jschappet avatar Jan 04 '19 17:01 jschappet

Hi @jschappet, Please try the following: define a subclass of KingTable, overriding sortColumns function to do nothing. This function is called upon initialization, to apply the first order to the columns, here in code.

class YourKingTable extends KingTable {
    sortColumns() {
        return this;
    }
}

Then use your subclass.

You will still be able to set columns order by using the function setColumnsOrder. I didn't test but it should work, that is why I use the word "try".

RobertoPrevato avatar Jan 05 '19 09:01 RobertoPrevato