Coder Social home page Coder Social logo

Comments (3)

mattiash avatar mattiash commented on August 19, 2024

Can you explain why you added the orderBy part of the filter? It will reorder the items in the array, but then tablesorter will reorder them again later in the filter.

from angular-tablesort.

shawkenator avatar shawkenator commented on August 19, 2024

Yeah, it's because of the additional sort buttons are little more complex than the table headers sorts. One example of the sorting buttons I need implemented says "Bring X to the top", now the value of X is coming through the service request, but isn't listed in as a table column. And to make it even more challenging, to sort the objects that contain this X value to the top, I have to do it in reverse. And if I use a ts-criteria, the user would have to hit the button twice in order to achieve the desired sort. I asked on an earlier ticket, if I can start sorting in reverse and I believe you said the answer was no.

from angular-tablesort.

mattiash avatar mattiash commented on August 19, 2024

But how can the orderBy statement have any effect at all? What ts-repeat does is that it effectively adds an extra orderBy clause to the end of the ng-repeat expression. The ng-repeat expression is a pipeline where parameters.response generates an array, orderBy rearranges the items in the array in a different order, filter:paramquery removes some entries from the array and then finally the orderBy added angular-tablesort reorders the items again. This means that the operation done by your orderBy filter is nullified by the orderBy added by angular-tablesort.

angular-tablesort can only sort by simple fields, it cannot take a sorting function. I think you are trying to do too much with angular-tablesort and you probably have to write your own custom tablesort routines.

from angular-tablesort.

Related Issues (20)

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.