Commit 0321103a authored by jgould's avatar jgould

use header with

parent 1a198dc4
...@@ -310,14 +310,19 @@ morpheus.Grid.prototype = { ...@@ -310,14 +310,19 @@ morpheus.Grid.prototype = {
left : -1000, left : -1000,
top : -1000 top : -1000
}); });
var $row = $('<div class="slick-table"><div class="ui-widget-content slick-row"><div class="slick-cell selected"></div></div></div>');
var $row = $('<div class="slick-table">'
+ '<div class="ui-state-default slick-header-column slick-header-sortable ui-sortable-handle"></div>'
+ '<div class="ui-widget-content slick-row"><div class="slick-cell selected"></div></div>'
+ '</div>');
var $cell = $row.find('.slick-cell'); var $cell = $row.find('.slick-cell');
var $header = $row.find('.slick-header-column');
$row.appendTo($d); $row.appendTo($d);
var gridWidth = this.options.$el.width(); var gridWidth = this.options.$el.width();
var maxWidth = Math.min(parseInt(gridWidth / 2), 400); var maxWidth = Math.min(parseInt(gridWidth / 2), 400);
var getColumnWidth = function(column) { var getColumnWidth = function(column) {
$cell.html(column.name); var w = $header.html(column.name).outerWidth();
var w = Math.max($cell.outerWidth(), 4); w = Math.max($cell.outerWidth(), w);
if (column.prototypeValue) { if (column.prototypeValue) {
$cell.html(column.prototypeValue); $cell.html(column.prototypeValue);
w = Math.max($cell.outerWidth(), w); w = Math.max($cell.outerWidth(), w);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment