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

Configure globally #610

Closed
bytestream opened this issue Dec 16, 2019 · 7 comments
Closed

Configure globally #610

bytestream opened this issue Dec 16, 2019 · 7 comments

Comments

@bytestream
Copy link
Contributor

It would be good if we could set global defaults for the configuration, particularly for language

$.fn.yadcf.defaults = {}

I think it would just be a simple case of adding $.extend({}, $.fn.yadcf.defaults, params) here https://github.com/vedmack/yadcf/blob/master/dist/jquery.dataTables.yadcf.js#L4642

@vedmack
Copy link
Owner

vedmack commented Dec 29, 2019

Do you mean like this (it's from the yadcf js file docs)?

* Global Parameters (per table rather than per column)
*
* Usage example yadcf.init(oTable,[{column_number : 0}, {column_number: 3}],{cumulative_filtering: true});

The third argument is being applied to all columns

@bytestream
Copy link
Contributor Author

No, I mean global for every table. #287 requires you to set lang on every table you want to change the language? I just want to set a languages definition once and it apply to every yadcf instance.

@bytestream
Copy link
Contributor Author

@vedmack will you accept a PR for this? and when is the next release expected?

I need a single place to set languages rather than

// template1.html
oTable.yadcf([/* unique column definition */], {
  language = {'select': 'Select value'}
});
// template2.html
oTable.yadcf([/* unique column defintion */], {
  language = {'select': 'Select value'}
});

@vedmack
Copy link
Owner

vedmack commented Feb 13, 2020

Sure, a PR is always welcomed

@bytestream
Copy link
Contributor Author

Sent #617

@vedmack
Copy link
Owner

vedmack commented Feb 27, 2020

thanks! I will try to merge it when I'll find some spare time

@bytestream
Copy link
Contributor Author

@vedmack sorry to ping but any chance of seeing this merged and released?

vedmack added a commit that referenced this issue May 21, 2020
Resolves #610
Allow set global defaults for the configuration (languages / etc')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants