select2 plug-in data getting deleted in database when bubble editing

select2 plug-in data getting deleted in database when bubble editing

clazetteclazette Posts: 26Questions: 7Answers: 2

When I submit a change of another field, via the bubble editor, any previous data saved in the full editor form with a select2 type is overwritten. If I change the field type to a checkbox and bubble edit, everything works as expected. Does anyone know why this would be the case?

{
                "label": "Area(s):",
                "name": "areas[].ID",
                "type": "select2",                               
                "opts": {
                            "placeholder":     "Select Area(s)",
                            "allowClear":      true,
                            "multiple":        true//,
                            //"tags":            true,
                            //"tokenSeparators": [',', ' ']
                }
                //,
                //render: function ( data, type, row ) {                    
                    //return (alert(row['value']));                   
                //}*/
            }, 

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I've just tried modifying this example locally to use Select2 - this was the field definition I used:

                {
                    "label": "Access:",
                    "name": "access[].id",
                    type: "select2",
                    "opts": {
                        "placeholder":     "Select Area(s)",
                        "allowClear":      true,
                        "multiple":        true
                   }
                }
    

    It actually appears to work okay, but I am running a dev version of Editor which I believe has already addressed the issue. It will be released as Editor 1.5.5 probably on Monday.

    When you submit the bubble edit what parameters are submitted to the server?

    Thanks,
    Allan

  • clazetteclazette Posts: 26Questions: 7Answers: 2

    Allan,
    The issue is that the areas array is empty when another field is edited via the bubble editor. This is not the case if I change the type to checkbox. For some reason, the select2 payload doesn't go along for the ride.

    select2

    ,"areas":[]}
    

    checkbox

    ,"areas":[{"ID":"2","area_desc":"Front Cradle"},{"ID":"1","area_desc":"Support"}]}
    

    Thank you very much for your help and if you want to send 1.5.5 beta I am more than willing to see if that solves the issue.

    Chad

This discussion has been closed.