Closed grafxflow closed 2 years ago
Please, stop asking about things not related to this package. If you want to sort an array, just check google for help.
use Illuminate\Support\Arr;
$table->selectFilter('model', Arr::sort([
4 => 'Name1',
1 => 'Name2',
2 => 'Name3',
3 => 'Name4',
]));
But what I am noticing is your function requires the options to be an array not an object and vuejs automatically ignores all the keys no matter what order Laravel places them in and just puts them numerically.
In fact ignore it will be easier to fork and make the appropriate amends. Thanks for your help.
This is not my package. I'm only an user.
The options must be and array because you are working in PHP and arrays are easier to handle. Just sort your array as you want and the options will be displayed like that.
As mentioned vuejs ignores the array int key order by default for select inputs, but this package is a nice starting to expand upon.
I there any way to use the selectFilter and have it sortBy using the value if its numerical?
So for example:
So it outputs: