jerrylow / basictable

Basic Table jQuery or Vanilla JS plugin for simple responsive tables.
MIT License
127 stars 57 forks source link

Issue with dynamic table #9

Closed joko13 closed 5 years ago

joko13 commented 5 years ago

When a new table row gets added dynamically via AJAX/KnockoutJS, the table headers of the new row are blank in responsive mode. I tried basictable('destroy') and running basictable again after the new row gets added dynamically, but the table headers dont show up in responsive mode.

jerrylow commented 5 years ago

@joko13 did you select the table and initiate start after the ajax table was generated?

MahmoudH96 commented 5 years ago

Yes I did but the same result, I tried to destroy it and then recreate the table, besides trying to stop and start it but I still got the same results, the new dynamic row does not contain any headers like the following image: issue

jerrylow commented 5 years ago

@MahmoudH96 did you do a destroy then start?

$('table').basictable('destroy');
$('table').basictable('start');

https://jsfiddle.net/0daoebzf/1/

jerrylow commented 5 years ago

@MahmoudH96 I just added a restart method so you don't have to redefine the table settings again, https://github.com/jerrylow/basictable#restart

MahmoudH96 commented 5 years ago

I will try it, thanks