Support textareas in backgrid.

pull/3/head
Khushboo Vashi 2016-03-16 14:48:09 +00:00 committed by Dave Page
parent 41805d40b5
commit 3df180831f
2 changed files with 40 additions and 0 deletions

View File

@ -789,4 +789,13 @@ td.edit-cell.editable.sortable.renderable.editor {
margin: 0 auto;
position: relative;
text-align: center;
}
.backgrid .textarea-cell {
text-align: left;
}
.backgrid .textarea-cell.editor textarea {
width: 100%;
height: auto;
}

View File

@ -413,6 +413,37 @@
model.set(column.get("name"), this.$select.val());
}
});
/**
TextareaCellEditor the cell editor renders a textarea multi-line text input
box as its editor.
@class Backgrid.TextareaCellEditor
@extends Backgrid.InputCellEditor
*/
var TextareaCellEditor = Backgrid.TextareaCellEditor = Backgrid.InputCellEditor.extend({
/** @property */
tagName: "textarea",
events: {
"blur": "saveOrCancel",
"keydown": ""
}
});
/**
TextareaCell displays multiline HTML strings.
@class Backgrid.Extension.TextareaCell
@extends Backgrid.Cell
*/
var TextareaCell = Backgrid.Extension.TextareaCell = Backgrid.Cell.extend({
/** @property */
className: "textarea-cell",
editor: TextareaCellEditor
});
return Backgrid;
}));