@@ -3081,7 +3081,7 @@ return /******/ (function(modules) { // webpackBootstrap
30813081 if (tableRows.length === 0 && !this.props.withoutNoDataText) {
30823082 var colSpan = this.props.columns.filter(function (c) {
30833083 return !c.hidden;
3084- }).length + (isSelectRowDefined ? 1 : 0) + (this.props.expandColumnOptions.expandColumnVisible ? 1 : 0);
3084+ }).length + (isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? 1 : 0) + (this.props.expandColumnOptions.expandColumnVisible ? 1 : 0);
30853085 tableRows = [_react2.default.createElement(
30863086 _TableRow2.default,
30873087 { key: '##table-empty##' },
@@ -11743,7 +11743,7 @@ return /******/ (function(modules) { // webpackBootstrap
1174311743 }
1174411744 } else if (column.editable && column.editable.validator) {
1174511745 // process validate
11746- tempMsg = column.editable.validator(newRow[column.field]);
11746+ tempMsg = column.editable.validator(newRow[column.field], newRow );
1174711747 responseType = typeof tempMsg === 'undefined' ? 'undefined' : _typeof(tempMsg);
1174811748 if (responseType !== 'object' && tempMsg !== true) {
1174911749 _this3.displayCommonMessage();
@@ -14078,7 +14078,11 @@ return /******/ (function(modules) { // webpackBootstrap
1407814078 var getElement = customInsertEditor.getElement;
1407914079
1408014080 fieldElement = getElement(column, attr, 'form-control', ignoreEditable, defaultValue);
14081- } else {
14081+ }
14082+
14083+ // fieldElement = false, means to use default editor when enable custom editor
14084+ // Becasuse some users want to have default editor based on some condition.
14085+ if (!customInsertEditor || fieldElement === false) {
1408214086 fieldElement = (0, _Editor2.default)(editable, attr, format, '', defaultValue, ignoreEditable);
1408314087 }
1408414088
@@ -16723,9 +16727,7 @@ return /******/ (function(modules) { // webpackBootstrap
1672316727 }, {
1672416728 key: 'cleanFiltered',
1672516729 value: function cleanFiltered() {
16726- if (this.props.filter === undefined) {
16727- return;
16728- }
16730+ if (!this.props.filter) return;
1672916731
1673016732 switch (this.props.filter.type) {
1673116733 case _Const2.default.FILTER_TYPE.TEXT:
@@ -16763,7 +16765,7 @@ return /******/ (function(modules) { // webpackBootstrap
1676316765 }, {
1676416766 key: 'applyFilter',
1676516767 value: function applyFilter(val) {
16766- if (this.props.filter === undefined ) return;
16768+ if (! this.props.filter) return;
1676716769 switch (this.props.filter.type) {
1676816770 case _Const2.default.FILTER_TYPE.TEXT:
1676916771 {
@@ -17171,6 +17173,9 @@ return /******/ (function(modules) { // webpackBootstrap
1717117173
1717217174 _this.filter = _this.filter.bind(_this);
1717317175 _this.timeout = null;
17176+ _this.state = {
17177+ value: _this.props.defaultValue || ''
17178+ };
1717417179 return _this;
1717517180 }
1717617181
@@ -17183,6 +17188,9 @@ return /******/ (function(modules) { // webpackBootstrap
1718317188 clearTimeout(this.timeout);
1718417189 }
1718517190 var filterValue = event.target.value;
17191+ this.setState(function () {
17192+ return { value: filterValue };
17193+ });
1718617194 this.timeout = setTimeout(function () {
1718717195 _this2.props.filterHandler(filterValue, _Const2.default.FILTER_TYPE.TEXT);
1718817196 }, this.props.delay);
@@ -17191,13 +17199,17 @@ return /******/ (function(modules) { // webpackBootstrap
1719117199 key: 'cleanFiltered',
1719217200 value: function cleanFiltered() {
1719317201 var value = this.props.defaultValue ? this.props.defaultValue : '';
17194- this.refs.inputText.value = value;
17202+ this.setState(function () {
17203+ return { value: value };
17204+ });
1719517205 this.props.filterHandler(value, _Const2.default.FILTER_TYPE.TEXT);
1719617206 }
1719717207 }, {
1719817208 key: 'applyFilter',
1719917209 value: function applyFilter(filterText) {
17200- this.refs.inputText.value = filterText;
17210+ this.setState(function () {
17211+ return { value: filterText };
17212+ });
1720117213 this.props.filterHandler(filterText, _Const2.default.FILTER_TYPE.TEXT);
1720217214 }
1720317215 }, {
@@ -17208,6 +17220,13 @@ return /******/ (function(modules) { // webpackBootstrap
1720817220 this.props.filterHandler(defaultValue, _Const2.default.FILTER_TYPE.TEXT);
1720917221 }
1721017222 }
17223+ }, {
17224+ key: 'componentWillReceiveProps',
17225+ value: function componentWillReceiveProps(nextProps) {
17226+ if (nextProps.defaultValue !== this.props.defaultValue) {
17227+ this.applyFilter(nextProps.defaultValue || '');
17228+ }
17229+ }
1721117230 }, {
1721217231 key: 'componentWillUnmount',
1721317232 value: function componentWillUnmount() {
@@ -17219,7 +17238,6 @@ return /******/ (function(modules) { // webpackBootstrap
1721917238 var _props = this.props,
1722017239 placeholder = _props.placeholder,
1722117240 columnName = _props.columnName,
17222- defaultValue = _props.defaultValue,
1722317241 style = _props.style;
1722417242
1722517243 return _react2.default.createElement('input', { ref: 'inputText',
@@ -17228,7 +17246,7 @@ return /******/ (function(modules) { // webpackBootstrap
1722817246 style: style,
1722917247 onChange: this.filter,
1723017248 placeholder: placeholder || 'Enter ' + columnName + '...',
17231- defaultValue: defaultValue ? defaultValue : '' });
17249+ value: this.state.value });
1723217250 }
1723317251 }]);
1723417252
0 commit comments