Преглед изворни кода

+ TEST_RENDER_AS_REACT flag in TableAjax

Piotr Labudda пре 7 година
родитељ
комит
6947005dac
2 измењених фајлова са 3 додато и 1 уклоњено
  1. 1 0
      SE/se-lib/TableAjax.php
  2. 2 1
      SE/se-lib/TableAjax.php.TableAjax.js

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

@@ -431,6 +431,7 @@ class TableAjax extends ViewAjax {
 		UI::inlineJS(__FILE__ . '.TableAjax.js', [
 			'URI_BASE' => Request::getPathUri(),
 			'URI_WPS' => Request::getPathUri() . 'wps.php',
+			'RENDER_AS_REACT' => V::get('TEST_RENDER_AS_REACT', '', $_GET),
 			'DBG' => ('1' === V::get('DBG_JS', '', $_GET)),
 		]);
 		$filterInit = $this->_filterInit;

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

@@ -2,6 +2,7 @@ if (!URI_BASE) throw "Missing URI_BASE"; // => Request::getPathUri()
 if (!URI_WPS) throw "Missing URI_WPS";
 if (!global.jQuery) throw "Missing jQuery"
 var $ = global.jQuery
+var RENDER_AS_REACT = Boolean(RENDER_AS_REACT) || false
 var DBG = DBG || false;
 var DBG1 = true;
 
@@ -1191,7 +1192,7 @@ var TableAjax = function() {
 			jQuery(window).on('resize', priv.onWindowResize)
 		}
 		priv.initialRender();// set up _uiNode$...
-		// priv.initialReactRender(); // set up _reactUITableNode
+		if (RENDER_AS_REACT) priv.initialReactRender(); // set up _reactUITableNode
 		priv.options.types.string = ((priv.options.types || {}).string || {});
 		priv.options.types.number = ((priv.options.types || {}).number || {});
 		priv.options.types.bool = ((priv.options.types || {}).bool || {});