Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field select2 multiple : ignore #5

Open
ldesmeules opened this issue Jul 27, 2016 · 1 comment
Open

Field select2 multiple : ignore #5

ldesmeules opened this issue Jul 27, 2016 · 1 comment

Comments

@ldesmeules
Copy link

ldesmeules commented Jul 27, 2016

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();
    },`
@lenamtl
Copy link

lenamtl commented Jul 27, 2016

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants