|
@@ -50,6 +50,14 @@ var P5UI__TableAjaxSortableLabel = createReactClass({
|
|
|
if (!this.props.isSortable) return;
|
|
if (!this.props.isSortable) return;
|
|
|
this.props.store.dispatch( this.props.actions.toggleSort( this.props.fieldName ) )
|
|
this.props.store.dispatch( this.props.actions.toggleSort( this.props.fieldName ) )
|
|
|
},
|
|
},
|
|
|
|
|
+ convertLabelHtmlLinesToRect: function (htmlLines) {
|
|
|
|
|
+ return htmlLines.split('<br>').reduce(function (reactNodesList, line) {
|
|
|
|
|
+ return reactNodesList.length
|
|
|
|
|
+ ? reactNodesList.concat( h('br'), line )
|
|
|
|
|
+ : reactNodesList.concat( line )
|
|
|
|
|
+ ;
|
|
|
|
|
+ }, []);
|
|
|
|
|
+ },
|
|
|
render: function () {
|
|
render: function () {
|
|
|
DBG && console.log('DBG::P5UI__TableAjaxSortableLabel::render (field:'+this.props.fieldName+')', { props: this.props, state: this.state });
|
|
DBG && console.log('DBG::P5UI__TableAjaxSortableLabel::render (field:'+this.props.fieldName+')', { props: this.props, state: this.state });
|
|
|
var isSorted = ( this.props.isSortable && this.props.fieldName === this.state.currSortCol );
|
|
var isSorted = ( this.props.isSortable && this.props.fieldName === this.state.currSortCol );
|
|
@@ -58,13 +66,13 @@ var P5UI__TableAjaxSortableLabel = createReactClass({
|
|
|
var fieldProps = this.props.fieldProps;
|
|
var fieldProps = this.props.fieldProps;
|
|
|
|
|
|
|
|
var label = this.props.fieldName;
|
|
var label = this.props.fieldName;
|
|
|
- if (fieldProps.friendly) label = fieldProps.friendly;
|
|
|
|
|
|
|
+ if (fieldProps.friendly) label = this.convertLabelHtmlLinesToRect(fieldProps.friendly);
|
|
|
var labelElements = ('ref' === fieldProps.type && fieldProps.xsdRefType)
|
|
var labelElements = ('ref' === fieldProps.type && fieldProps.xsdRefType)
|
|
|
? [
|
|
? [
|
|
|
h('i', { style: { 'padding-right': "2px" }, className: "glyphicon glyphicon-export" }),
|
|
h('i', { style: { 'padding-right': "2px" }, className: "glyphicon glyphicon-export" }),
|
|
|
fieldProps.xsdRefType
|
|
fieldProps.xsdRefType
|
|
|
]
|
|
]
|
|
|
- : [ label ]
|
|
|
|
|
|
|
+ : label
|
|
|
;
|
|
;
|
|
|
|
|
|
|
|
var title = this.props.fieldName;
|
|
var title = this.props.fieldName;
|