language.searchBuilder.conditions

language.searchBuilder.conditions

LapointeLapointe Posts: 430Questions: 81Answers: 4

Hi
The page https://datatables.net/reference/option/language.searchBuilder.conditions.moment display informations about localisation of conditions used in searchBuilder
in this page we can see : https://datatables.net/reference/option/language.searchBuilder.condition.moment without s at condition word (and broken link when click on).
I expect than conditions is the correct term, because 'condition' translate the conditions placeHolder.
So I do try to localise options as

        $.extend( true, $.fn.dataTable.defaults, {        // datatables language
            language: {
                searchBuilder: {
                    add: 'Ajouter',
                    button: 'Filtres',
                    clearAll: 'Reset',
                    condition: 'Opérateur',
                    conditions :{
                        date: {
                            before: 'Avant le',
                            after: 'Après le',
                            equals: 'Egual à',
                            not: 'Différent de',
                            between: 'Entre',
                            notBetween: 'Pas entre',
                            empty: 'Vide',
                            notEmpty: 'Pas vide'
                        },
                        moment: {
                            before: 'Avant le',
                            after: 'Après le',
                            equals: 'Egual à',
                            not: 'Différent de',
                            between: 'Entre',
                            notBetween: 'Pas entre',
                            empty: 'Vide',
                            notEmpty: 'Pas vide'
                        },
                        number: {
                            equals: 'Egual à',
                            not: 'Différent de',
                            gt: 'Supérieur à',
                            gte: 'Supérieur ou égal à',
                            lt: 'Inférieur à',
                            lte: 'Inférieur ou égal à',
                            between: 'Entre',
                            notBetween: 'Pas entre',
                            empty: 'Vide',
                            notEmpty: 'Pas vide'
                        },
                        string: {
                            contains: 'Contient',
                            empty: 'Vide',
                            notEmpty: 'Pas vide',
                            equals: 'Egual à',
                            not: 'Différent de',
                            endsWith: 'Termine par',
                            startsWith: 'Commence par'
                        },
                    },
                    data: 'Colonne',
                    logicAnd: 'ET',
                    logicOr: 'OU',
                    title: {
                        0: 'Aucun Filtre',
                        _: 'Filtrés (%d)'

                    },
                    deleteTitle: 'Supprimer',
                    leftTitle: 'Gauche',
                    rightTitle: 'Droite',
                    value: 'Valeur',
                },
                infoFiltered:       " (filtrés - _MAX_ au total)",
........

Everything is ok else localised conditions...

I try to set them directly (not using extend defaults) with same result.

Does somebody can help please ?

This question has accepted answers - jump to:

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @Lapointe ,

    The property names that you are using are correct. I've miss-spelt in the docs and have raised an issue for this (DD-1717 for my reference). We will get that fixed soon.

    Could you please link to a test case so that I can see try to see why the custom options are not being used? Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,
    Sandy

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @sandy

    http://live.datatables.net/ruvagabi/1/edit

    As you can see, the column type detection is not correct (at least for age) .
    It look like text comparator list (for salary too).
    I post another question about localised date fields, to allow searchBuilder date picker to be set as the table is...
    Thanks
    Bob

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    That looks like a problem fixed in the nightly releases. I've updated your example here and it seems to be working as expected. Please could you take a look and confirm.

    We're aiming to push this release in the next couple of weeks.

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4
    edited November 2020

    Hi @colin @sandy
    For localisation it's ok
    ~~for field type detection, not yet... Salary and age seem to propose text comparators~~.
    Else how to localise (customize) serchBuilder DatePicker to reflect editor datePicker
    http://live.datatables.net/cegewowu/1/

    Roberto (bob)

    edit :
    I just get the nightly searcBuider and it looks to work for field type detection (not in your sample http://live.datatables.net/fatopuyu/1/edit) but in mine (http://live.datatables.net/cegewowu/1/)

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    http://live.datatables.net/cegewowu/1 without parenthesis is better

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi all
    If filter condition is 'between' the 'and' term between start and end inputs is not localised ...

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @Lapointe ,

    Good spot, 'and' there should indeed have an internationalisation option. I've raised an issue internally (DD-1719 for my reference) and will report back here when there is an update. This will probably be at the end of the week.

    Thanks,
    Sandy

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @sandy
    I'm disapointed... On my one real case, field type de tection is not correct for numeric fields... and can't understand why...
    as you can see in the json below, each field 'Montant' is numeric... and searchBuilder does not yet display the correct list for this type of column...

    {"data":[{"DT_RowId":"row_43","recettes":{"ID":43,"ID_Client":1,"ID_Situation":45,"ID_Prestation":5,"ID_ModeReglement":2,"Montant":20,"Date":"sam. 24 oct. 2020 22:39","DateBanque":null,"MoisUrssaf":"","ID_Utilisateur":1},"civilites":{"Libelle":"M."},"clients":{"Nom":"Lemahieu","Prenom":"Bruno","CodePostal":27400},"situations":{"Libelle":"G41"},"prestations":{"Libelle":"Hypnose art"},"modes_reglement":{"Libelle":"Ch\u00e8que"},"utilisateurs":{"Nom":"Bindelli","ID":1}},{"DT_RowId":"row_45","recettes":{"ID":45,"ID_Client":7,"ID_Situation":43,"ID_Prestation":3,"ID_ModeReglement":3,"Montant":123,"Date":"mar. 27 oct. 2020 10:10","DateBanque":"sam. 31 oct. 2020 00:00","MoisUrssaf":"","ID_Utilisateur":3},"civilites":{"Libelle":null},"clients":{"Nom":"z","Prenom":"z","CodePostal":"zzzzz"},"situations":{"Libelle":"L1"},"prestations":{"Libelle":"Syst\u00e9mie"},"modes_reglement":{"Libelle":"Carte Bancaire"},"utilisateurs":{"Nom":"Lemahieu","ID":3}},{"DT_RowId":"row_39","recettes":{"ID":39,"ID_Client":5,"ID_Situation":44,"ID_Prestation":11,"ID_ModeReglement":3,"Montant":60,"Date":"lun. 19 oct. 2020 19:15","DateBanque":null,"MoisUrssaf":"","ID_Utilisateur":4},"civilites":{"Libelle":null},"clients":{"Nom":"Relaxation","Prenom":"Pr\u00e9nomTest","CodePostal":12345},"situations":{"Libelle":"R3"},"prestations":{"Libelle":"Relax new"},"modes_reglement":{"Libelle":"Carte Bancaire"},"utilisateurs":{"Nom":"Relaxation","ID":4}}],"options":{"recettes.ID_Client":[{"label":"Bindelli Roberto","value":2},{"label":"Lemahieu Bruno","value":1},{"label":"Relaxation Pr\u00e9nomTest","value":5},{"label":"z z","value":7}],"recettes.ID_Situation":[{"label":"Angoisse","value":1},{"label":"B","value":36},{"label":"B2","value":37},{"label":"B3","value":40},{"label":"G41","value":45},{"label":"Global test","value":4},{"label":"L1","value":43},{"label":"R1","value":41},{"label":"R2","value":42},{"label":"R3","value":44},{"label":"Troubles du sommeil","value":2}],"recettes.ID_Prestation":[{"value":"","label":""},{"label":"Hypnose","value":1},{"label":"Hypnose an","value":4},{"label":"Hypnose art","value":5},{"label":"Nouvelle Prestation","value":8},{"label":"PNL","value":2},{"label":"Relax new","value":11},{"label":"Relax P1","value":9},{"label":"Relax p2","value":10},{"label":"Syst\u00e9mie","value":3}],"recettes.ID_ModeReglement":[{"value":"","label":""},{"label":"Carte Bancaire","value":3},{"label":"Ch\u00e8que","value":2},{"label":"Liquide","value":4},{"label":"Virement","value":1}]},"files":[],"searchPanes":{"options":[]}}
    

    Is there a way to create test case with ajax file on live.datatables.net ?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You could use something like Mockjax - see here. There are sites that you can setup to send Ajax too,

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4
    edited November 2020

    hi

    For information...
    using

        <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    

    run
    Using

        <script src="https://code.jquery.com/jquery-3.5.1.js"></script>
    

    does not...

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @sandy @colin
    I do test and test and feel bad...
    Testing ajax using colin link (Mockjax) run correctly... Numeric fields comparator list is correct...
    Using directly the app with the same data does not run on my dev env...

    So please if can help...
    username NUJBD6DE pwd NUJBD6DE
    http://dafaction.appinfo.fr/

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    hi @colin

    using jquery-3.5.1.min.js in place of jquery-1.11.3.min.js the sample here does not run and stay at 'loading' state...

    <?php ?? ?>
  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It looks like incompatible versions with Mockjax - I updated Mockjax to 2.6.0 and it appears to be behaving as expected: http://live.datatables.net/fucamoqa/19/edit

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Thank @colin

    Did you have a look to why column 'Montant' is not detected as numeric in searchBuilder ?

    Roberto

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @Lapointe ,

    Running the following on your page

    $('#donnees').DataTable().columns().type().toArray()

    Shows that the column type for 'Montant' is 'num.', this is because you are setting the decimal place in your language plugin. This is actually the default so if you comment that line out it will work. That being said, it is also something that we should support, so, I've raised an issue internally (DD-1720 for my reference) and will report back here when there is an update. Again, probably at the end of the week.

    Thanks,
    Sandy

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Yep...
    I was feeling I was mad... :s
    Thanks for this information.
    I'll wait for update to set decimal point again...

    Roberto

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    The fix for this is in the nightly releases here. We're aiming to release these in the next couple of weeks,

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Thanks for all your support.

    Bob

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Thanks for all your support.

    Bob

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    OOPS: link broken...
    The requested URL was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Sorry but not OK
    date fields seem to be detected as text when formatted like

    If I edit the field datepicker is OK

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Could you knock out a test case for that, please, it'll help us debug it.

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @colin
    Yes I willhope monday....
    This week end it's MotoGP for me.
    I'll come back soon
    Thanks

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    else do you have a private mail so I can send you a couple log/pwd to access at online system with admin privileges...

This discussion has been closed.