vedmack / yadcf

Yet Another DataTables Column Filter (yadcf)
http://yadcf-showcase.appspot.com/
MIT License
731 stars 285 forks source link

Resolves #610 #617

Closed bytestream closed 4 years ago

bytestream commented 4 years ago

Usage:

    yadcf.setDefaults({
        language: {
            'filter': 'Escribe para filtrar',
        }
    });
bytestream commented 4 years ago

@vedmack any chances of seeing this merged/released soon? 🤞

vedmack commented 4 years ago

Please add fallback for users of prev version of yadcf (read from params.language and put the values into the default_options.language + console.log message saying "please use the new API before calling ytadcf... etc', make it clear for users that used to use the old API that it is deprecated and will be obsolete in the future" for this in the parts of the code that used to read language param if (params.language !== undefined) { and set it into the defaults In addition, please post a jsfiddle test page showing how your new code works (minimal example)

bytestream commented 4 years ago

@vedmack I don't think that's necessary? The changes are fully BC. If you use params.language then it still works the same as before. The only difference is that this PR allows you to configure options without initialisation.

https://jsfiddle.net/7zfuscmt/

Above shows both old way and new way.

vedmack commented 4 years ago

ok, cool, then add a bit of documentation at the bottom of the External API functions: section

vedmack commented 4 years ago

will release a new version in a day or two, thanks for the PR

bytestream commented 4 years ago

Woha that was fast 😅

Thanks :)

vedmack commented 4 years ago

changed it into initDefaults, and no need for 'strings' you can use values yadcf.initDefaults({language: {select: 'Pick some'}});

* initDefaults
                Description:        Set global defaults for all yadcf instances.
                Arguments:          Object consisting of anything defined inside default_options varaible
                Usage example:      yadcf.initDefaults({language: {select: 'Pick some'}});