question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.4: defaultSort does not seem to work

See original GitHub issue

Not sure if it’s just my environment (latest chrome, windows 10) but adding defaultSort: "name" to a list does not seem to enable sorting on that list field.

I’ve added keystonejs/keystonejs-site#54 just in case it’s a documentation issue.

Warning messages in console: image

Used like this (according to doc example):

var MyList = new keystone.List('MyList', {
    defaultSort: '+name'
});
MyList.add({
    name: {
        type: String,
    },
    ...
});

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
geloeschtcommented, Apr 13, 2016

Well, defaultSort : 'name' works, as does defaultSort : '-name'. Usage with a plus sign is not mentioned in the docs as far as I can tell, but probably should be possible for the sake of completeness.

0reactions
mnsrvcommented, Jul 11, 2016

ok, sorry, I forget to add createdAt field. example contains it, so there is no mistake. it’s my fault.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Search components "Default Sort Order dropdown cut off by ...
The Search component's Default Sort Order is cut off by the TouchUI dialog content container making it appear as though "Descending" is not...
Read more >
274766 - Default Sort Changed - Bugzilla@Mozilla
Oops! The default seems to be by Status, not Severity. It's still different from Bug ID, which was the previous default.
Read more >
Array sort is not working correctly in JavaScript - Stack Overflow
The code above will return the array sorted from smallest to largest correctly. You can sort largest to smallest (descending order) by reversing ......
Read more >
Template:DEFAULTSORT - Wikipedia
{{DEFAULTSORT:<sort key>}} is a magic word used to modify the sequence of pages shown on category pages. The given sort key in a...
Read more >
Examples • reactable - GitHub Pages
Sorting. Tables are sortable by default. You can sort a column by clicking on its header, or sort multiple columns by holding the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found