rstaib / jquery-bootgrid

Nice, sleek and intuitive. A grid control especially designed for bootstrap.
http://www.jquery-bootgrid.com
MIT License
972 stars 362 forks source link

Header isn't rendered without a parent for the table #287

Open jorkzijlstra opened 8 years ago

jorkzijlstra commented 8 years ago

If you create the table in memory and instantiate the bootgrid on this it doesn't render the header. This because the header is inserted before the table. The code rendering the header goes outside the this scope (this.element.parent()) which should not be done.

Doesn't render header:

var table = $('<table></table>')
table.bootgrid({})
$('#grid-div').append(table)

Works:

var table = $('<table></table>')
var tableWithParent = $('<div></div>').append(table)
table.bootgrid({})
$('#grid-div').append(tableWithParent)