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

DTOptions fromFnPromise, can change options #139

Closed
cdeturche opened this issue Dec 1, 2014 · 2 comments
Closed

DTOptions fromFnPromise, can change options #139

cdeturche opened this issue Dec 1, 2014 · 2 comments
Labels
Milestone

Comments

@cdeturche
Copy link

I use angular-tables with promise.

vm.dtOptions = DTOptionsBuilder
            .fromFnPromise(
                return requestDataservice.getRequests(vm.searchRequest.criteria);
            )
            .withLanguageSource('assets/i18n/datatables/fr.json')
            .withDisplayLength(50);

I would like add the possibility to change the language but it doesn't work.

vm.dtOptions = DTOptionsBuilder
            .fromFnPromise(
                return requestDataservice.getRequests(vm.searchRequest.criteria);
            )
            .withLanguageSource('assets/i18n/datatables/de.json')
            .withDisplayLength(100);

The language and the display length doesn't change.

It works before when I use angular way with :

vm.dtOptions = DTOptionsBuilder
            .newOptions(
                return requestDataservice.getRequests(vm.searchRequest.criteria);
            )
            .withLanguageSource('assets/i18n/datatables/de.json');

Thank you

@cdeturche
Copy link
Author

My comment is not very clear.

When I speak about the possibility to change language, it's during the use of application. When I choose the language in a select element.

When I redefine the options when I use newOptions(), it's ok but not with fromFnPromise.

@l-lin
Copy link
Owner

l-lin commented Dec 1, 2014

Nice catch 👍 Didn't notice that the DT options are not reloaded.

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