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

Reference field sortDir and sortField are being overridden somewhere #576

Closed
ulikus opened this issue Jul 29, 2015 · 1 comment
Closed
Assignees
Labels

Comments

@ulikus
Copy link

ulikus commented Jul 29, 2015

cannot get them to work
here is the code snippet,

login.editionView()
    .fields([
        nga.field('username'),
        nga.field('password'),
        nga.field('user', 'reference')
            .perPage(10)
            .sortDir("ASC")
            .sortField("nickname")
            .label('User')
            .targetEntity(user)
            .targetField(nga.field('nickname'))
    ]);

but the actual request is sent with "id" and "DESC"
i guess its a bug?

@BearTM
Copy link

BearTM commented Aug 2, 2015

I found that you can specify the (default) .sortField('xxx') in the listView() creation. This appears to work across all views for that entity.

The following should (hopefully) work for you.

user.listView()
    .fields([
        ...
    ])
    .sortDir("ASC")
    .sortField("nickname");

I don't know why the field specification doesn't apply the sortField() 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

3 participants