jquery-bootpag icon indicating copy to clipboard operation
jquery-bootpag copied to clipboard

How I can destroy or refresh component?

Open clairekh opened this issue 8 years ago • 2 comments

How I can destroy or refresh component?

I need refresh pagination component with new total parameter after ajax. How I can do this?

clairekh avatar Nov 18 '16 12:11 clairekh

it would be great if you can add a call to destroy api.

I am using this with ajax pagination at below. It allows you query the results with AJAX call. So if no result, I need to unbind its events. Because otherwise, it later multiples calls on pagination links.

            if($('#tbody').children('tr').length) {
                if($('ul.bootpag').length) {
                    $('#pagination-wrapper').bootpag({total: rData.total_pages, maxVisible:10});
                } else {
                    $('#pagination-wrapper').bootpag({
                        total: rData.total_pages,
                        maxVisible: 10,
                        page: qS.p,
                    }).on("page", function(event, num){
                        qS.p = num;
                        history.pushState(qS, null, EYS.URI.getUriString() + '?' + $.param(qS));
                        EYS.XHR.call('module/users/xhr_table_data', qS, null, dump_rows);
                        $(this).bootpag({total: rData.total_pages, maxVisible:10});
                    });
                }
            } else {
                 $('#pagination-wrapper').empty();
            }

yahyaerturan avatar Mar 11 '17 08:03 yahyaerturan

@yahyaerturan You can use off("page") to unbind event

ParadeTo avatar Jun 03 '17 08:06 ParadeTo