Giter VIP home page Giter VIP logo

Comments (3)

AlexanderKrutov avatar AlexanderKrutov commented on May 27, 2024 1

@VictorioBerra I think it should be separate setting in DataTablesColumn, like existing ColumnSearchPredicate.
I've already implemented this in commit. So the usage will be something like this:

Server-side:

// take column options
var column = request.Columns[p => p.ManagedBy];
// set search predicate
column.ColumnSearchPredicate= p => p.ManagedBy.Name.Contains(column.SearchValue);
// set ordering by nested property (Name)
column.ColumnOrderingProperty= p => p.ManagedBy.Name;

Client-side:

{
    targets: 3,
    "data": "ManagedBy",
    "render": function (data, type, row) {
        return row.ManagedBy.Name + ' (' + row.ManagedBy.EmailAddress + ')';
    }
},

from datatables.queryable.

VictorioBerra avatar VictorioBerra commented on May 27, 2024

So, in order to get around the error and specify a property you can do something like this in your table columnsDef:

{
    targets: 3,
    "data": "ManagedBy.Name",
    "render": function (data, type, row) {
        return row.ManagedBy.Name + ' (' + row.ManagedBy.EmailAddress + ')';
    }
},

But my server still evaluates this locally because of the complex object.

from datatables.queryable.

VictorioBerra avatar VictorioBerra commented on May 27, 2024

@AlexanderKrutov Is there a way we could do ColumnOrderingPredicate instead somehow? A more advanced situation is needing to do cusomers.OrderBy(x => x.CustomerOrderLine).OrderBy(x => Order.Name)

I have an issue now with needing to order by properties inside my many to many relationship. I wonder if this will get easier when EF Core lets you omit the many-to-many table? then the nestedt properties will exist without jumping through the associative table.

from datatables.queryable.

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.