ソースを参照

+ sortable and filterable column props in TableAjax

Piotr Labudda 7 年 前
コミット
08b3e16c3f
2 ファイル変更4 行追加1 行削除
  1. 2 0
      SE/se-lib/TableAjax.php
  2. 2 1
      SE/se-lib/TableAjax.php.TableAjax.js

+ 2 - 0
SE/se-lib/TableAjax.php

@@ -2205,6 +2205,8 @@ jQuery(document).ready(function(){
 				DBG::log($typeSpecial, 'array', "\$typeSpecial id({$fieldID}) col({$col})");
 				$columnConfig->_tsRetId = $typeSpecial->getReturnId();
 				if ($columnConfig->_tsRetId == 0) {
+					$columnConfig->sortable = false;
+					$columnConfig->filterable = false;
 					$tsParamOut = V::get('param_out', null, $typeSpecial);
 					if ($tsParamOut) {
 						$tsFormat = V::get('format', null, $tsParamOut);

+ 2 - 1
SE/se-lib/TableAjax.php.TableAjax.js

@@ -1912,7 +1912,7 @@ var TableAjax = function() {
 			ReactDOM.render(
 				h(P5UI__TableAjaxSortableLabel, {
 					namespace: priv.options.namespace,
-					isSortable: (props.type != 'special' && props.type != 'geom' && props.type != "simpleLink" && props.type != "ref"), // TODO: props.isSortable
+					isSortable: (props.sortable !== false && props.type != 'special' && props.type != 'geom' && props.type != "simpleLink" && props.type != "ref"), // TODO: props.sortable
 					fieldName: column,
 					fieldProps: props,
 					store: priv.options.filterStore,
@@ -2004,6 +2004,7 @@ var TableAjax = function() {
 			headCell.css({padding: '0'});
 			if (i == 1) headCell.addClass('stickyCol stickyCol3');
 
+			if (props.filterable === false) continue;
 			ReactDOM.render(
 				h(p5UI__FieldInputFilterSearch, {
 					disabled: (priv.options.forceFilterInit && undefined !== priv.options.forceFilterInit[column]),