Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support of nested columns #46

Open
dohomi opened this issue Jul 25, 2014 · 3 comments
Open

support of nested columns #46

dohomi opened this issue Jul 25, 2014 · 3 comments
Labels

Comments

@dohomi
Copy link

dohomi commented Jul 25, 2014

Hello,

I just made a quick tryout to show all Meteor.users in a DataTable to test this plugin.

Template.userList.users = function () {
    return {
        id: "operator-user-list",
        columns: [
            {
                title: "ID",
                data: "_id"
            },
            {
                title: "First name",
                data: "profile.firstName"
            },
            {
                title: "Last name",
                data: "profile.lastName"
            }
        ],
        subscription: "operatorAllUser"
    }
};

Template.html:

{{> DataTable users}}

Publication:

var UserTable = new DataTableComponent({
    subscription: "operatorAllUser",
    collection: Meteor.users
});

UserTable.publish();

The _id of the user is displayed, but profile.firstName and profile.lastName is empty. Thanks for some infos.

@dohomi
Copy link
Author

dohomi commented Jul 26, 2014

Hello again, with following code the data is getting rendered:

mRender: function (data, type, row) {
                    return data;
                }

But now I am facing the problem that the ordering is now working correctly. Any ideas why? Thanks

@gjolund
Copy link
Contributor

gjolund commented Jul 31, 2014

Are you still defining the data property? That is what datatables uses to determine sort order.

@dohomi
Copy link
Author

dohomi commented Aug 1, 2014

@austinrivas I figured out that it was because of mongodb sort and case sensitivity. Sorting seems to work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants