0

i have a table that i update but when i update it with

<p:commandButton id="someId" update="table" value="Button" action="#{gestionduplanning.exec2}" />

but my jquery sortable code didnt work after the update .

 $( init );    
function init() {

            $(".list-items").sortable({
            connectWith: '.list-items',
            items: "li:not(.item.new)",
            placeholder: 'place-holder',
            scroll: false,
            tolerance: "pointer",update: function (event, ui) {
            //alert($(this));
            }, 
                receive : function(e, ui) { 

                }

        }).disableSelection();

        }

how to fixe the sortable after the update ??

marouanoviche
  • 253
  • 4
  • 11
  • 28

1 Answers1

0

Add oncomplete="init();" to your button,

Like this:

<p:commandButton oncomplete="init();" id="someId" update="table" value="Button" action="#{gestionduplanning.exec2}" />
Daniel
  • 36,833
  • 10
  • 119
  • 200