y2w / bootstrap-table-treetable

bootstrap-table plugin to show a tree structure in a table

Home Page:https://github.com/y2w/bootstrap-table-treetable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bootstrap-table-treetable

#Usage

<script src="src/bootstrap-table-treetable.js"></script>

#Options ###treetable

  • type: Boolean
  • description: Set true to allow the treetable in one column.
  • default: false

#Example

var $table=$('.table');
$table.bootstrapTable({ 
      url: 'your url', 
      pagination : true,
      sidePagination : "server",
      columns:  [ 
                  { field: '_state', checkbox: true}, 
                  { title: 'root', field: 'id',  expanded:true}, 
                  { title: 'title', field: 'title'}  
                ] 
  }); 
  $table.on('treetable-expand.bs.table', function(self,field,row) {
	$.getJSON(url,function(data){
		$table.bootstrapTable('addTreeNode', {row: data.rows}); 
	})
});

About

bootstrap-table plugin to show a tree structure in a table

https://github.com/y2w/bootstrap-table-treetable