/*
 * Copyright (c) 2012-2014 Kaarle Ritvanen
 * See LICENSE file for license details
 */

define(["aconf/widget/table/row", "jquery"], function(Base, $) {
    return Base.extend({
	init: function(
	    data, name, meta, level, editable, removable
	) {
	    this.header = $("<tr>");
	    var table = $("<table>");
	    table.append($("<thead>").html(this.header));
	    table.append($("<tbody>").html(
		Base.init.call(
		    this,
		    data,
		    name,
		    meta,
		    level,
		    editable,
		    removable
		)
	    ));
	    return table;
	},
	
	appendWidget: function(el, label) {
	    this.header.append($("<th>").text(label));
	    return Base.appendWidget.call(this, el, label);
	}
    });
});
