Code Monkey home page Code Monkey logo

nova-sortable's People

Contributors

lilianjin avatar lorenzosapora avatar ralphschindler avatar shaffe-fr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nova-sortable's Issues

Resource Index Breaking Because of indexQuery

After implementing indexQuery thusly:

    /**
     * Build an "index" query for the given resource.
     *
     * @param  \Laravel\Nova\Http\Requests\NovaRequest  $request
     * @param  \Illuminate\Database\Eloquent\Builder  $query
     *
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public static function indexQuery(NovaRequest $request, $query)
    {
        $query->when(empty($request->get('orderBy')), function (Builder $q) {
            $q->getQuery()->orders = [];
            return $q->orderBy('sort_order');
        });

        return $query;
    }

I'm getting the following error whenever loading my resource's index page:

Argument 1 passed to App\Nova\FaqCategory::App\Nova{closure}() must be an instance of App\Nova\Builder, instance of Illuminate\Database\Eloquent\Builder given, called in /var/www/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php on line 91

Is this an issue with newer versions of Nova, or how can I fix this?

Localized Toast messages

Is there any way to have a localized Toast messages instead of changing it in ResourceTable.vue?

this.$toasted.show(
   this.__('The new order has been set!'),
    {type: 'success'}
);

Prevent page refresh after sorting

Lovely package! My only complaint is that the page refreshes after sorting. I noticed other sort packages behave like this as well so I am not sure it is even possible to fix.

IndexQuery not working...

@lilianjin I've already filed an issue with @davidhemphill over at /nova-issues, but I'm curious if you've found a workaround? I'm unable to affect ANY type of sorting on my index. No matter how I try to orderBy the $query, Nova sorts by ID by default. So I can rearrange the index sorting all I want using this package (which is great, BTW), but once I refresh the page the sort order (visually) reverts back to sorted by ID... any ideas?

Issue with pagination

When relations are paginated it acts really weird when sorting. Sorting the second page makes the items appear before the items on the first page.
This isn't too big of a problem as I just disable pagination in this case, but it would be cool if it would take into account the page it is on (if that's even possible).

Weird index position

I have a table with less than 100 records and the position column as NULL. When I sort any record, it updates the position of all records on that page, but the index starts at 11000. Is it the expected behaviour? Because, since the other records position are NULL, they are shown first after the page refresh.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.