jstreegrid
Version:
grid plugin for jstree
83 lines (80 loc) • 2.26 kB
HTML
<script type="text/javascript">
$(document).ready(function(){
var tree_data = [
{
type: 'document',
text: 'Syllabus'
},
{
type: 'folder',
text: 'Introduction',
children: [
{
type: 'document',
text: 'introduction page 1',
data: {
due_date: '3/18/2015'
}
},
{
type: 'document',
text: 'introduction page 2',
data: {
due_date: '3/18/2015'
}
}
]
},
{
type: 'folder',
text: 'Subject',
children: [
{
type: 'document',
text: 'subject page 1',
data: {
due_date: '4/8/2015'
}
},
{
type: 'document',
text: 'subject page 2',
data: {
hidden: true,
due_date: '4/8/2015'
}
},
{
type: 'document',
text: 'subject page 3',
data: {
due_date: '4/8/2015'
}
}
]
}
];
$('#tree').jstree({
core: {
data: tree_data
},
plugins: ['grid'],
grid: {
columns: [
{width: 'auto', header: 'File'},
{width: 90, header: 'Due date', value: 'due_date'}
],
resizable: true
}
});
});
</script>
<h1>Column Resize Chrome Test</h1>
<p>
There is an issue with Chrome/Chromium wherein if a column size is set to 'auto', calling $(col).css("width") returns 0, rather than the actual width. This tests whether or not it works.
</p>
<p>
The bug hits primarily during resizing. To test this, try resizing a column in Firefox and then in Chrome.
</p>
<div id="tree">
</div>