LocalStorage Select disabled

0

I have this design

And what I am trying to do is that those who are disabled save them in the localStorage and that when refreshing the page or close and open it again they remain disabled

    $(function() {
            $('.asignarConteo').on('click', function(e) {
                $('.widthSelect :selected[value!="0"]').closest("tr").each(function() {
                    //console.log(
                    //    $(this).find(".iarticulo").text(),
                    console.log($(this).find(":selected").val());

                    var ar = $(this).find(".iarticulo").text();
                    var usu = $(this).find(":selected").text();
                    $.ajax({
                        url: 'http://localhost:3000/AsigUsuarios',
                        method: 'post',
                        //persist: true,
                        //cache: true,
                        data: { idArticulo: ar, Usuario: usu },
                        success: function(res) {
                            console.log(res);
                            console.log('Entro');
                            $(".widthSelect").filter(function() {
                                return this.selectedIndex > 0;
                            }).prop('disabled', true);

                            //SaveLocalStorage
                    //Store in local storage.
                    localStorage.setItem('rowsSelected', 'disabled');
                    //Read from local storage.
                    localStorage.getItem('rowsSelected');
                        }
                    });
                })
            });

        });
    
asked by Eduard 24.07.2017 в 16:37
source

0 answers