Trouble with Editor fieds select

Trouble with Editor fieds select

jquijadojquijado Posts: 24Questions: 6Answers: 0
edited December 2016 in Free community support

I'm using the Datatables Editor with a field select for two tables with the data of the examples. I've built a seletc field with the name of the city. Cities are in a different table from the one with staff names, In the staff table I have a field which is id_ciudad (the id of the city in the cities table).
The trouble is that I can't get the right city seleceted. It aways appears selected Edimburgh, even if that is not the city o the member of the staff I'm editing. The Editor object has been created in the following way:

        var objetoEditor = new $.fn.dataTable.Editor({
            ajax: 'crud_editor_04.php',
            table: '#tabla_de_personal', 
            idSrc: 'id',
            i18n: {
                create: {
                    button: "Nuevo",
                    title:  "Crear nuevo registro",
                    submit: "Grabar"
                },
                edit: {
                    button: "Editar",
                    title:  "Editar registro",
                    submit: "Actualizar"
                },
                remove: {
                    button: "Borrar",
                    title:  "Borrar registro",
                    submit: "Borrar", 
                    confirm: {
                        _: "¿Estás seguro de eliminar estos %d registros?",
                        1: "¿Estás seguro de eliminar este registro?"
                    }
                },
                multi: {
                    title: "Múltiples valores",
                    info: "Los registros seleccionados contienen diversos valores para este campo. Para editar este campo con el mismo valor en los registros seleccionados, pulsa aquí. En caso conterario, los registros mantendrán sus valores individuales en este campo.",
                    restore: "Restaurar los valores múltiples",
                    noMulti: "Esta entrada puede ser modificada individualmente, pero no como parte de un grupo."
                },
                datetime: {
                    previous:   'Anterior',
                    next:       'Siguiente',
                    months:     ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
                    weekdays:   ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb']
                }
            },
            fields: [
                {label: 'Nombre:', name: 'personal.nombre', attr: {class:'form-control'}},
                {label: 'Apellido:', name: 'personal.apellido', attr: {class:'form-control'}},
                {label: 'Cargo:', name: 'personal.cargo', attr: {class:'form-control'}},
```             {```
```                 label: 'Ciudad:', ```
```                 name: 'personal.id_ciudad',```
```                 attr: {class:'form-control'}, ```
```                 type: "select", ```
```                 options: [```
```                     {label:'Edinburgh', value:'1'},```
```                     {label:'London', value:'2'},```
```                     {label:'New York', value:'3'},```
```                     {label:'San Francisco', value:'4'},```
```                     {label:'Sidney', value:'5'},```
```                     {label:'Singapore', value:'6'},```
```                     {label:'Tokyo', value:'7'}```
```                 ]```
```             },```
                {
                    label: 'F. Ingreso:', 
                    name: 'personal.fecha_de_ingreso', 
                    type: 'date', 
                    def: function(){return new Date();}, 
                    dateFormat: 'dd-mm-yy', 
                    attr: {readonly:true, class:'form-control', style:'display:inline'}, 
                    opts:{
                        buttonImage:'editor/images/calendar.png',
                        buttonImageOnly: true, 
                        buttonText: 'Elegir fecha', 
                        dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'], 
                        dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sá'], 
                        dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
                        firstDay: 1, 
                        monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
                        monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
                        changeMonth: true,
                        changeYear: true, 
                        prevText: "Anterior", 
                        nextText: "Siguiente"
                    }
                },
                {
                    label: 'Salario anual:', 
                    name: 'personal.salario_bruto_anual',
                    attr: {class:'form-control'}, 
                    fieldInfo: 'El salario debe ir como valor numérico, con dos decimales (incluso si son 00), separados por un punto.'
                },
            ]
        });

How can I mark an option of the select field as selected? I've tried def: 'personal.id_ciudad', def:'ciudades.id' and def:'ciudades.id' but nothing works. No preselected option in my select.

I've bought a single developer License today, for the case it is a trial limitation, but it does not work all the same.

Can someone help me?

Thanks a lot everyone.

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin

    The error suggests that the values to be edited don't match the values that have been configured as options. Possibly in this case that might be because the data is numbers, while the values you have given are strings? I'd need a link to the page to be sure.

    Allan

  • jquijadojquijado Posts: 24Questions: 6Answers: 0

    Dear Allan.
    There's no link to the page, since I'm actually trying the editor in localhost. I could, instead of that, send you a copy of the files I'm using, if you give me an address mail for sending them.
    All the same, the id in the database is numeric but, when converted to JSON is processed as atring, and ím trying to use it as a string.

    By the way, I,ve finally bougth the license, since I'm sure it's a great product (in spite of I'm slow to learn), and i've recommended some other colleagues to buy it too.

    Thanks for your helpful. You have really created a great product.

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin

    Thank you :smile:.

    Could you show me the JSON returned from the server and also your DataTables initialisation? That will hopefully let me identify what is happening.

    Allan

  • jquijadojquijado Posts: 24Questions: 6Answers: 0
    edited December 2016

    Of course. Datatables object is defined like this:

            var objetoDataTables_personal = $('#tabla_de_personal').DataTable({
                "language": {
                    select: {
                        rows: {
                            _: "%d registros seleccionados",
                            0: "No se han seleccionado registros",
                            1: "1 registro seleccionado"
                        }
                    },
                    "emptyTable":           "No hay datos disponibles en la tabla.",
                    "info":                 "Del _START_ al _END_ de _TOTAL_ ",
                    "infoEmpty":            "Mostrando 0 registros de un total de 0.",
                    "infoFiltered":         "(filtrados de un total de _MAX_ registros)",
                    "infoPostFix":          "(actualizados)",
                    "lengthMenu":           "Mostrar _MENU_ registros",
                    "loadingRecords":       "Cargando...",
                    "processing":           "Procesando...",
                    "search":               "Buscar:",
                    "searchPlaceholder":    "Dato para buscar",
                    "zeroRecords":          "No se han encontrado coincidencias.",
                    "paginate": {
                        "first":            "Primera",
                        "last":             "Última",
                        "next":             "Siguiente",
                        "previous":         "Anterior"
                    },
                    "aria": {
                        "sortAscending":    "Ordenación ascendente",
                        "sortDescending":   "Ordenación descendente"
                    }
                },
                "lengthMenu":               [[5, 10, 20, 25, 50, -1], [5, 10, 20, 25, 50, "Todos"]],
                "iDisplayLength":           10,
                "bServerSide":              true,
                "sAjaxSource":              "datos_externos_editor_04.php",
                "columns" : [
                    {"data": 'personal.nombre'},
                    {"data": 'personal.apellido'},
                    {"data": 'cargos.cargo'},
                    {"data": 'ciudades.ciudad'}, 
                    {"data": 'personal.fecha_de_ingreso'}, 
                    {"data": 'personal.salario_bruto_anual', className: "text-right"}
                ],
                "columnDefs": [
                    {
                        "targets": 5,
                        "render": function (data) {
                            return salaryFormat(data);
                        }
                    }
                ],
                select:                     true,
                dom:                        'Bfrtip',
                buttons: [
                    {extend: 'create', editor: objetoEditor},
                    {extend: 'edit', editor: objetoEditor},
                    {extend: 'remove', editor: objetoEditor}
                ]
            });
    

    When Datatatables is loaded, my php script returns a JSON like this (copied from Chrome console):

    data:[{id: "5",…}, {id: "25",…}, {id: "3",…}, {id: "19",…}, {id: "28",…}, {id: "6",…}, {id: "43",…},…]
        0:{id: "5",…}
            cargos:{cargo: "Accountant"}
                cargo:"Accountant"
            ciudades:{ciudad: "Tokyo"}
                ciudad:"Tokyo"
            id:"5"
            personal:{nombre: "Airi", apellido: "Satou", cargo: "1", ciudad: "7", fecha_de_ingreso: "28-11-2008",…}
                apellido:"Satou"
                cargo:"1"
                ciudad:"7"
                fecha_de_ingreso:"28-11-2008"
                nombre:"Airi"
                salario_bruto_anual:"162700.00"
        1:{id: "25",…}
            cargos:{cargo: "Chief Executive Officer (CEO)"}
                cargo:"Chief Executive Officer (CEO)"
            ciudades:{ciudad: "London"}
                ciudad:"London"
            id:"25"
            personal:{nombre: "Angelica", apellido: "York", cargo: "2", ciudad: "2", fecha_de_ingreso: "09-10-2009",…}
                apellido:"York"
                cargo:"2"
                ciudad:"2"
                fecha_de_ingreso:"09-10-2009"
                nombre:"Angelica"
                salario_bruto_anual:"1200000.00"
        2:{id: "3",…}
            cargos:{cargo: "Junior Technical Author"}
                cargo:"Junior Technical Author"
            ciudades:{ciudad: "San Francisco"}
                ciudad:"San Francisco"
            id:"3"
            personal:{nombre: "Ashton", apellido: "Cox", cargo: "15", ciudad: "4", fecha_de_ingreso: "12-01-2009",…}
                apellido:"Cox"
                cargo:"15"
                ciudad:"4"
                fecha_de_ingreso:"12-01-2009"
                nombre:"Ashton"
                salario_bruto_anual:"86000.00"
        3:{id: "19",…}
            cargos:{cargo: "Software Engineer"}
                cargo:"Software Engineer"
            ciudades:{ciudad: "London"}
                ciudad:"London"
            id:"19"
            personal:{nombre: "Bradley", apellido: "Greer", cargo: "27", ciudad: "2", fecha_de_ingreso: "13-10-2012",…}
                apellido:"Greer"
                cargo:"27"
                ciudad:"2"
                fecha_de_ingreso:"13-10-2012"
                nombre:"Bradley"
                salario_bruto_anual:"132000.00"
        4:{id: "28",…}
            cargos:{cargo: "Software Engineer"}
                cargo:"Software Engineer"
            ciudades:{ciudad: "San Francisco"}
                ciudad:"San Francisco"
            id:"28"
            personal:{nombre: "Brenden", apellido: "Wagner", cargo: "27", ciudad: "4", fecha_de_ingreso: "07-06-2011",…}
                apellido:"Wagner"
                cargo:"27"
                ciudad:"4"
                fecha_de_ingreso:"07-06-2011"
                nombre:"Brenden"
                salario_bruto_anual:"206850.00"
        5:{id: "6",…}
            cargos: {cargo: "Integration Specialist"}
                cargo:"Integration Specialist"
            ciudades:{ciudad: "New York"}
                ciudad:"New York"
            id:"6"
            personal:{nombre: "Brielle", apellido: "Williamson", cargo: "12", ciudad: "3", fecha_de_ingreso: "02-12-2012",…}
                apellido:"Williamson"
                cargo:"12"
                ciudad:"3"
                fecha_de_ingreso:"02-12-2012"
                nombre:"Brielle"
                salario_bruto_anual:"372000.00"
        6:{id: "43",…}
            cargos:{cargo: "Software Engineer"}
                cargo:"Software Engineer"
            ciudades:{ciudad: "London"}
                ciudad:"London"
            id:"43"
            personal:{nombre: "Bruno", apellido: "Nash", cargo: "27", ciudad: "2", fecha_de_ingreso: "03-05-2011",…}
                apellido:"Nash"
                cargo:"27"
                ciudad:"2"
                fecha_de_ingreso:"03-05-2011"
                nombre:"Bruno"
                salario_bruto_anual:"163500.00"
        7:{id: "23",…}
            cargos:{cargo: "Pre-Sales Support"}
                cargo:"Pre-Sales Support"
            ciudades:{ciudad: "New York"}
                ciudad:"New York"
            id:"23"
            personal:{nombre: "Caesar", apellido: "Vance", cargo: "20", ciudad: "3", fecha_de_ingreso: "12-12-2011",…}
                apellido:"Vance"
                cargo:"20"
                ciudad:"3"
                fecha_de_ingreso:"12-12-2011"
                nombre:"Caesar"
                salario_bruto_anual:"106450.00"
        8:{id: "51",…}
            cargos:{cargo: "Sales Assistant"}
                cargo:"Sales Assistant"
            ciudades:{ciudad: "New York"}
                ciudad:"New York"
            id:"51"
            personal:{nombre: "Cara", apellido: "Stevens", cargo: "23", ciudad: "3", fecha_de_ingreso: "06-12-2011",…}
                apellido:"Stevens"
                cargo:"23"
                ciudad:"3"
                fecha_de_ingreso:"06-12-2011"
                nombre:"Cara"
                salario_bruto_anual:"145600.00"
        9:{id: "4",…}
            cargos:{cargo: "Senior Javascript Developer"}
                cargo:"Senior Javascript Developer"
            ciudades:{ciudad: "Edinburgh"}
                ciudad:"Edinburgh"
            id:"4"
            personal:{nombre: "Cedric", apellido: "Kelly", cargo: "25", ciudad: "1", fecha_de_ingreso: "29-03-2012",…}
                apellido:"Kelly"
                cargo:"25"
                ciudad:"1"
                fecha_de_ingreso:"29-03-2012"
                nombre:"Cedric"
                salario_bruto_anual:"433060.00"
    
    
        iTotalDisplayRecords:"57"
        iTotalRecords:"57"
        sEcho:1
    

    It continues on next comment...

  • jquijadojquijado Posts: 24Questions: 6Answers: 0
    edited December 2016

    Comes from previous comment...

    The Editor object, since I need it to get up to date data on "cargo" (position) and "ciudad" (city), has been rewritten like this:

            var listaDeCiudades = '';
            var listaDeCargos = '';
    
            var objetoEditor = new $.fn.dataTable.Editor({
                ajax: 'crud_editor_04.php',
                table: '#tabla_de_personal', 
                idSrc: 'id',
                i18n: {
                    create: {
                        button: "Nuevo",
                        title:  "Crear nuevo registro",
                        submit: "Grabar"
                    },
                    edit: {
                        button: "Editar",
                        title:  "Editar registro",
                        submit: "Actualizar"
                    },
                    remove: {
                        button: "Borrar",
                        title:  "Borrar registro",
                        submit: "Borrar", 
                        confirm: {
                            _: "¿Estás seguro de eliminar estos %d registros?",
                            1: "¿Estás seguro de eliminar este registro?"
                        }
                    },
                    multi: {
                        title: "Múltiples valores",
                        info: "Los registros seleccionados contienen diversos valores para este campo. Para editar este campo con el mismo valor en los registros seleccionados, pulsa aquí. En caso conterario, los registros mantendrán sus valores individuales en este campo.",
                        restore: "Restaurar los valores múltiples",
                        noMulti: "Esta entrada puede ser modificada individualmente, pero no como parte de un grupo."
                    },
                    datetime: {
                        previous:   'Anterior',
                        next:       'Siguiente',
                        months:     ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
                        weekdays:   ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb']
                    }
                },
                fields: [
                    {label: 'Nombre:', name: 'personal.nombre', attr: {class:'form-control'}},
                    {label: 'Apellido:', name: 'personal.apellido', attr: {class:'form-control'}},
                    {
                        label: 'Cargo:', 
                        name: 'personal.id_cargo', 
                        attr: {class:'form-control'}, 
                        type: 'select'
                    },
                    {
                        label: 'Ciudad:', 
                        name: 'personal.id_ciudad',
                        attr: {class:'form-control'}, 
                        type: 'select'
                    },
                    {
                        label: 'F. Ingreso:', 
                        name: 'personal.fecha_de_ingreso', 
                        type: 'date', 
                        def: function(){return new Date();}, 
                        dateFormat: 'dd-mm-yy', 
                        attr: {readonly:true, class:'form-control', style:'display:inline'}, 
                        opts:{
                            buttonImage:'editor/images/calendar.png',
                            buttonImageOnly: true, 
                            buttonText: 'Elegir fecha', 
                            dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'], 
                            dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sá'], 
                            dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
                            firstDay: 1, 
                            monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
                            monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
                            changeMonth: true,
                            changeYear: true, 
                            prevText: "Anterior", 
                            nextText: "Siguiente"
                        }
                    },
                    {
                        label: 'Salario anual:', 
                        name: 'personal.salario_bruto_anual', 
                        attr: {class:'form-control'}, 
                        fieldInfo: 'El salario debe ir como valor numérico, con dos decimales (incluso si son 00), separados por un punto.'
                    },
                ]
            });
            objetoEditor.on('preOpen', function(e, mode, action){
                $.ajax({
                    url:"leer_ciudades_editor_04.php", 
                    async:false,
                    dataType: "JSON",
                    complete:function(datosRecibidos) {
                        listaDeCiudades = datosRecibidos.responseText;
                    }
                });
                objetoEditor.s.fields['personal.id_ciudad']._addOptions(eval(listaDeCiudades));
                $.ajax({
                    url:"leer_cargos_editor_04.php", 
                    async:false,
                    dataType: "JSON",
                    complete:function(datosRecibidos) {
                        listaDeCargos = datosRecibidos.responseText;
                    }
                });
            objetoEditor.s.fields['personal.id_cargo']._addOptions(eval(listaDeCargos));
            });
    

    The JSON's for positions and cities, as they appear in the Chrome console, are the following:

    0:{value: "1", label: "Edinburgh"}
    1:{value: "2", label: "London"}
    2:{value: "3", label: "New York"}
    3:{value: "4", label: "San Francisco"}
    4:{value: "5", label: "Sidney"}
    5:{value: "6", label: "Singapore"}
    6:{value: "7", label: "Tokyo"}
    

    AND

    0:{value: "1", label: "Accountant"}
    1:{value: "2", label: "Chief Executive Officer (CEO)"}
    2:{value: "3", label: "Chief Financial Officer (CFO)"}
    3:{value: "4", label: "Chief Marketing Officer (CMO)"}
    4:{value: "5", label: "Chief Operating Officer (COO)"}
    5:{value: "6", label: "Customer Support"}
    6:{value: "7", label: "Data Coordinator"}
    7:{value: "8", label: "Developer"}
    8:{value: "9", label: "Development Lead"}
    9:{value: "10", label: "Director"}
    10:{value: "11", label: "Financial Controller"}
    11:{value: "12", label: "Integration Specialist"}
    12:{value: "13", label: "Javascript Developer"}
    13:{value: "14", label: "Junior Javascript Developer"}
    14:{value: "15", label: "Junior Technical Author"}
    15:{value: "16", label: "Marketing Designer"}
    16:{value: "17", label: "Office Manager"}
    17:{value: "18", label: "Personnel Lead"}
    18:{value: "19", label: "Post-Sales support"}
    19:{value: "20", label: "Pre-Sales Support"}
    20:{value: "21", label: "Regional Director"}
    21:{value: "22", label: "Regional Marketing"}
    22:{value: "23", label: "Sales Assistant"}
    23:{value: "24", label: "Secretary"}
    24:{value: "25", label: "Senior Javascript Developer"}
    25:{value: "26", label: "Senior Marketing Designer"}
    26:{value: "27", label: "Software Engineer"}
    27:{value: "28", label: "Support Engineer"}
    28:{value: "29", label: "Support Lead"}
    29:{value: "30", label: "System Architect"}
    30:{value: "31", label: "Systems Administrator"}
    31:{value: "32", label: "Team Leader"}
    32:{value: "33", label: "Technical Author"}
    

    The trouble is that the select fields are properly loaded with the lists, but it always appears the first item selected, instead of the real one. I see JSON's as the ones in the examples pages of your site, so I've tried a lot of combinations, but I can't do it works properly. If I'm putting my foot in it, I can see it.

    Once else, thanks a lot. This type of helpful makes a tool like this more interesting for users.

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin

    objetoEditor.s.fields['personal.id_ciudad']._addOptions(eval(listaDeCiudades));

    That is using a private parameter. I would suggest you use the API instead:

    objetoEditor.field( 'personal.id_ciudad' ).update( options );
    

    I would also point out that eval is evil. Use JSON.parse( listaDeCiudades ); if it is a string, although given that you set dataType: "JSON", I'd be surprised if it was needed, but its impossible to say for sure without access to the page.

    Allan

  • jquijadojquijado Posts: 24Questions: 6Answers: 0

    Dear Allan:
    First of all, I thank you for your advice about field().update().

    I've put de whole test which makes me crazy in http://datatables-test.000webhostapp.com/

    As you can see, if you select a row and press the edit button, the select fields don't show the real option, but just the first one.

    The whole code is downloadable from http://datatables-test.000webhostapp.com/datatables_test.zip

    I've read the manual in your site, but I can't find the reason this doesn't work.

    Once again, thank you very much.

  • jquijadojquijado Posts: 24Questions: 6Answers: 0

    Dear Allan:
    About the touble with select fields, I've seen that, unlike your example, when I select more than one row and press the edit button, it doesn't show "Multiple values" in the select fields, but just in the text ones.

    That´s so obvious for me that I'm doing something bad, but I can´t see what is my mistake. I've viewed your examples, reference, manual... everything in your page.

    Are there any docs else I can review? What can I to do about this type of fieds?. It's a real big problem if I can't do they work properly.

    Thanks a lot and Merry Christmas to you.
    Regards.

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin

    It looks like the select values have been configured to be numbers - see attached screenshot.

    But the value being edited doesn't match, so it always just shows the first item in the select list.

    If you have a look in my join example you will see that it uses two fields in the data source - the label that is shown in the DataTable and the value that is edited in Editor. I would recommend taking a similar approach.

    Allan

  • jquijadojquijado Posts: 24Questions: 6Answers: 0
    edited December 2016

    Hi again, Allan:

    I've seen your example. It was my starting point when I began trying to use joined tables. The problem is I can't see any difference from the response in your example with the one of mine.

    I attach a picture with the data of both examples (yours and mine). As you can see, the select options are properly created. In the picture you can see a JSON in Chrome console too. As you can see, it looks to be right.

    So, there are several trouble with the select fields:
    * It doesn't select the right option
    * It doesn't show Multiple Values if there are more than one row selected when press Edit.
    * The placeholderDisabled property doesn't work (I've found about this just a few minutes ago).

    Might it be a bug in my copy of Editor? I really have no idea of what is hapenning. If JSON data are correct, my code should work the same way as yours, shouldn't?

    Can this be caused by the version? I really don't know what else to look at.

    Please, help me about this. Your tool is really powerful, and could save a lot of hours of work for me, but I need to know why this kind of fieds don't work for my code. :s

    PD. It seems I can´t attach an image to this comment, so the screenshot is in http://datatables-test.000webhostapp.com/screenshot.png

    Please help me. If I need an older version of the editor, please let me know the right link. The one I've downloaded when I purchased it is 1.6 I think. Could it be any kind of bug or incompatibilty with this version?

    Thanks again

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin
    Answer ✓

    Could it be any kind of bug or incompatibilty with this version?

    I don't believe so, no.

    Let's take the Ciudad field:

    name: 'personal.id_ciudad',

    However, in the data set returned from the server, there is no personal.id_ciudad property. This is what the personal object looks like:

            "personal": {
                "nombre": "Airi",
                "apellido": "Satou",
                "cargo": "1",
                "ciudad": "7",
                "fecha_de_ingreso": "28-11-2008",
                "salario_bruto_anual": "162700.00"
            },
    

    If you want to be able to edit that property you would need to include it in the data set so Editor knows what the current value is..

    Allan

  • jquijadojquijado Posts: 24Questions: 6Answers: 0

    Gosh, Allan:
    You are REALLY right. When I read the information in the page, I never understood the direct relationship between the columns in Datatables object and the source of data in the editor object. So there's really a bug, not in the editor, but in my mind.

    Now I'm thinking about it, this working way is absolutely logic. Even I haven't found about it in the manual, I should have understood it. I'm not used to a so powerful tool, and some of its functions require more attention from me.

    Really thanks for your helpful. You are really a good professional, and so kindful. :D ;)

    I wish you a happy new year.

  • Charlesto63Charlesto63 Posts: 2Questions: 0Answers: 1
    Answer ✓

    I had the same issue....

This discussion has been closed.