Skip to content

Field select2 multiple : ignore #5

@ldesmeules

Description

@ldesmeules

The data-is-dirrty value of Field select2 multiple is always true.

The solution I found to resolve
`

                                    checkValues: function(){
        var d = this;
        this.form.find("input, select, textarea").each( function(){
            var initialValue = $(this).attr("data-dirrty-initial-value");
            if($(this).val() != initialValue){
                $(this).attr("data-is-dirrty", "true");
            }else{
                $(this).attr("data-is-dirrty", "false");
            }
        });
        this.form.find("input[type=checkbox], input[type=radio]").each( function(){
            var initialValue = $(this).attr("data-dirrty-initial-value");
            if($(this).is(":checked") && initialValue != "checked"
                || !$(this).is(":checked") && initialValue == "checked"){
                $(this).attr("data-is-dirrty", "true");
            }else{
                $(this).attr("data-is-dirrty", "false");
            }
        });
                    this.form.find("input[type=search]").each( function(){

                        $(this).attr("data-is-dirrty", "false");
        });
        var isDirty = false;
        this.form.find("input, select, textarea").each( function(){
            if( $(this).attr("data-is-dirrty") == "true" ){
                isDirty = true;
            }
        });
        if(isDirty){
            d.setDirty();
        }else{
            d.setClean();
        }

        d.fireEvents();
    },`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions