Closed zhangmengxue closed 8 years ago
@AngeIII I was doing this
$('.pagination').twbsPagination('destory');
but I got an error: Uncaught TypeError: Cannot read property 'apply' of undefined
And I keep seeing the code:
$.fn.twbsPagination = function (option) {
var args = Array.prototype.slice.call(arguments, 1);
var methodReturn;
var $this = $(this);
var data = $this.data('twbs-pagination');
var options = typeof option === 'object' ? option : {};
if (!data) $this.data('twbs-pagination', (data = new TwbsPagination(this, options) ));
if (typeof option === 'string') methodReturn = data[ option ].apply(data, args);
return ( methodReturn === undefined ) ? $this : methodReturn;
};
The error seems from this...
Please make fiddle, of codepen. I will see what is going wrong. Possibly your pagination is not initialized.
Also we have test qunit for destroy method call, so it should be workable.
well ... the event name is destroy. spelling mistake..
It's finally work out.Thanks!
beautiful girl ! 哈哈
Many people have this problem. Why not write to documents.
We are ready to receive pull requests. You can update documentation and community will review it.
I was do some operate on my data. When the data changes,I want to init pagination again,based on the new datas.
This seems impossible. Could help me find out why?