forked from TFMM/silent-auction
feat: install and scaffold Tablar theme #6
@@ -18,18 +18,16 @@
|
||||
copyClassesToDropdown: false,
|
||||
dropdownParent: 'body',
|
||||
controlInput: '<input>',
|
||||
sortField: [{
|
||||
field: 'text',
|
||||
direction: 'asc'
|
||||
}],
|
||||
// Natural sort plugin or custom sorter:
|
||||
// We use a custom sort function to handle the "1 - ..." format
|
||||
// This ensures "1" < "2" < "10"
|
||||
sortField: {
|
||||
field: 'text',
|
||||
direction: 'asc',
|
||||
func: function(a, b) {
|
||||
return a.text.localeCompare(b.text, undefined, {numeric: true, sensitivity: 'base'});
|
||||
const valA = parseInt(a.text, 10);
|
||||
const valB = parseInt(b.text, 10);
|
||||
if (isNaN(valA) || isNaN(valB)) {
|
||||
return a.text.localeCompare(b.text);
|
||||
}
|
||||
return valA - valB;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user