is not called on ajax actions!
10071
public function beforeRender(Event $event)
    {

        parent::beforeRender($event);

        // when a shop order was placed, the pdfs that are rendered for the order confirmation email
        // called this method and therefore called resetOriginalLoggedCustomer() => email was sent t
        // the user who placed the order for a member and not to the member
        if ($this->getResponse()->getType() != 'text/html') {
            return;
        }

        $this->resetOriginalLoggedCustomer();

        $categoriesForMenu = [];
        if (Configure::read('appDb.FCS_SHOW_PRODUCTS_FOR_GUESTS') || $this->AppAuth->user()) {
            $this->Category = TableRegistry::getTableLocator()->get('Categories');
            $allProductsCount = $this->Category->getProductsByCategoryId(Configure::read('app.categoryAllProducts'), false, '', 0, true);
            $newProductsCount = $this->Category->getProductsByCategoryId(Configure::read('app.categoryAllProducts'), true, '', 0, true);
            $categoriesForMenu = $this->Category->getForMenu();
            array_unshift($categoriesForMenu, [
                'slug' => Configure::read('app.slugHelper')->getNewProducts(),
                'name' => __('New_products') . ' <span class="additional-info"> (' . $newProductsCount . ')</span>',
                'options' => [
                    'fa-icon' => 'fa-star' . ($newProductsCount > 0 ? ' gold' : '')
                ]
            ]);
            array_unshift($categoriesForMenu, [
                'slug' => Configure::read('app.slugHelper')->getAllProducts(),
                'name' => __('All_products') . ' <span class="additional-info"> (' . $allProductsCount . ')</span>',
                'options' => [
                    'fa-icon' => 'fa-tags'
                ]
            ]);
        }
        $this->set('categoriesForMenu', $categoriesForMenu);

        $this->Manufacturer = TableRegistry::getTableLocator()->get('Manufacturers');
        $manufacturersForMenu = $this->Manufacturer->getForMenu($this->AppAuth);
        $this->set('manufacturersForMenu', $manufacturersForMenu);

        $this->Page = TableRegistry::getTableLocator()->get('Pages');
        $conditions = [];
        $conditions['Pages.active'] = APP_ON;
        $conditions[] = 'Pages.position > 0';
        if (! $this->AppAuth->user()) {
            $conditions['Pages.is_private'] = APP_OFF;
        }

        $pages = $this->Page->getThreaded($conditions);
        $pagesForHeader = [];
        $pagesForFooter = [];
        foreach ($pages as $page) {
            if ($page->menu_type == 'header') {
                $pagesForHeader[] = $page;
            }
            if ($page->menu_type == 'footer') {
                $pagesForFooter[] = $page;
            }
        }
        $this->set('pagesForHeader', $pagesForHeader);
        $this->set('pagesForFooter', $pagesForFooter);
    }
523584
public function _ajax() {
		check_ajax_referer( $this->_get_nonce_key() );

		if ( ! isset( $_GET['post_id'] ) ) {
			$this->_send_json( '-' );
			return;
		}

		$post_id = sanitize_text_field( wp_unslash( $_GET['post_id'] ) );
		$count_cache = new Count_Cache( $post_id, $this->service_name );

		$cache = $count_cache->get();
		if ( $cache ) {
			$this->_send_json( $cache );
			return;
		}

		$count = $this->_request();
		$count_cache->update( $count );
		$this->_send_json( $count );
	}
179518
function renderActionButtons() {
        $('.manage-resource-container .action-button').each(function (i, action) {
            action = $(action);
            var type = action.parent().hasClass(FOLDER_TYPE) ? FOLDER_TYPE : "";
            var id = action.attr("id"),
                dataId = action.parent('.resource-item').attr("id");

            var actions = [
                {
                    text: type ? "View" : "Download",
                    onClick: function (e) {
                        if (type) {
                            renderItemsByFolderId(dataId);

                        } else {
                            download(dataId);
                        }
                    },
                    permissionAction: "VIEW"
                },
                {
                    text: "Permission", data: {id: dataId},
                    onClick: function (e) {
                        openPermissions(dataId);
                    },
                    permissionAction: "PERMISSION"
                },
                {
                    text: "Rename", data: {id: dataId},
                    onClick: function (e) {
                        rename(dataId, true);
                    },
                    permissionAction: "UPDATE"
                },
                {
                    text: "Delete",
                    onClick: function (e) {
                        remove(dataId, type);
                    },
                    permissionAction: "DELETE"
                }
            ];
            var opts = {
                handlerId: id,
                buttonSize: "mini",
                actions: actions
            };

            var permissionConf = {
                modelId: dataId,
                modelName: modelName,
                permissionSchemaKey: permissionSchemaKey
            };

            new Rocket.ActionButton(opts, permissionConf)
        });
    }
922181
def use_event_attributes?
        !skip_actions && !skip_after && actions.all? && actions.length == 1 && first.machine.action_hook?
      end
704906
public function updateSelect($id = null) {
		//$this->autoRender = false;
		if (!$this->request->is('post') || !$this->request->is('ajax')) {
			throw new Exception(__('not a valid request'));
		}
		$this->viewBuilder()->layout('ajax');
		$states = $this->States->getListByCountry($id);
		$defaultFieldLabel = 'pleaseSelect';
		if ($this->request->query('optional')) {
			$defaultFieldLabel = 'doesNotMatter';
		}

		$this->set(compact('states', 'defaultFieldLabel'));
	}
777268
@Override
	public void actionPerformed(ActionEvent event) {
		JMenuItem item = (JMenuItem) event.getSource();

		if (item.isSelected()) {
			showColumn(item.getText());
		} else {
			hideColumn(item.getText());
		}
	}
924111
function( url, els, isHijax ) {
			$.get( url, function( data, status, xhr ) {
				els.trigger( "ajaxIncludeResponse", [ data, xhr ] );
			});
		}
325262
public function ajax()
    {
        $builder = $this->prepare()
                ->filterColumn('field_1', function($query, $keyword) {
                    $keywordLower = mb_strtolower($keyword);
                    $keywordUpper = mb_strtoupper($keyword);
                    return $query->where('value', 'like', "%$keywordLower%")->orWhere('value', 'like', "%$keywordUpper%");
                })
                ->filterColumn('field_2', function($query, $keyword) {
            $keywordLower = mb_strtolower($keyword);
            $keywordUpper = mb_strtoupper($keyword);
            return $query->where('value', 'like', "%$keywordLower%")->orWhere('value', 'like', "%$keywordUpper%");
        });
        if (!auth()->guest() && !auth()->user()->hasRoles('member')) {
            $builder->editColumn('user_id', function($row) {
                $user = $row->user;
                return is_null($user) ? '---' : HTML::link(handles('antares/foundation::users/' . $user->id), '#' . $user->id . ' ' . $user->fullname);
            });
        }

        return $builder->editColumn('field_1', $this->getFieldOneColumnValue())
                        ->editColumn('field_2', $this->getFieldRow('field_2'))
                        ->addColumn('action', function($row) {
                            return $this->rowActions($row);
                        })->make(true);
    }
916490
function (options) {
            if (!options) {
                throw Error("Ajax options missing");
            }
            var that = this, util = Rocket.Util;
            options.success = util.ajaxResponse(options.callback);
            util.ajax(options);
        }
849111
public function run_ajax() {
    global $wp_query;

    if ( $wp_query->get("no-admin-ajax") ) {
      // Constant for plugins to know that we are on an AJAX request
      define("DOING_AJAX", true);

      // If we don't have an action, do nothing
      if ( ! isset( $_REQUEST["action"] ) ) {
          die(0);
      }

      // Escape the parameter to prevent disastrous things
      $action = esc_attr( $_REQUEST["action"] );

      // Run customized no-admin-ajax methods with action "no-admin-ajax/before"
      do_action( "no-admin-ajax/before" );

      // Run customized no-admin-ajax methods for specific ajax actions with "no-admin-ajax/before/{action}"
      do_action( "no-admin-ajax/before/". $action );

      // Same headers as WordPress normal AJAX routine sends
      $default_headers = array(
        "Content-Type: text/html; charset=" . get_option( "blog_charset" ),
        "X-Robots-Tag: noindex"
      );

      // Filter to customize the headers sent by ajax calls
      $headers = apply_filters( "no-admin-ajax/headers", $default_headers );

      // Send the headers to the user
      if ( is_array( $headers ) && count( $headers ) > 0 ) {
        foreach ( $headers as $header ) {
          @header( $header );
        }
      }

      send_nosniff_header();
      nocache_headers();

      // Run the actions
      if(is_user_logged_in()) {
          do_action( "wp_ajax_" . $action );
      }
      else {
          do_action( "wp_ajax_nopriv_" . $action );
      }

      die(0);
    }
  }
613060
public function admin_ajax() {

		if ( false === headers_sent() ) {
			pods_session_start();

			header( 'Content-Type: text/html; charset=' . get_bloginfo( 'charset' ) );
		}

		// Sanitize input
		// @codingStandardsIgnoreLine
		$params = pods_unslash( (array) $_POST );

		foreach ( $params as $key => $value ) {
			if ( 'action' === $key ) {
				continue;
			}

			// Fixup $_POST data @codingStandardsIgnoreLine
			$_POST[ str_replace( '_podsfix_', '', $key ) ] = $_POST[ $key ];

			// Fixup $params with unslashed data
			$params[ str_replace( '_podsfix_', '', $key ) ] = $value;

			// Unset the _podsfix_* keys
			unset( $params[ $key ] );
		}

		$params = (object) $params;

		$methods = array(
			'add_pod'                 => array( 'priv' => true ),
			'save_pod'                => array( 'priv' => true ),
			'load_sister_fields'      => array( 'priv' => true ),
			'process_form'            => array( 'custom_nonce' => true ),
			// priv handled through nonce
							'upgrade' => array( 'priv' => true ),
			'migrate'                 => array( 'priv' => true ),
		);

		/**
		 * AJAX Callbacks in field editor
		 *
		 * @since unknown
		 *
		 * @param array     $methods Callback methods.
		 * @param PodsAdmin $obj     PodsAdmin object.
		 */
		$methods = apply_filters( 'pods_admin_ajax_methods', $methods, $this );

		if ( ! isset( $params->method ) || ! isset( $methods[ $params->method ] ) ) {
			pods_error( 'Invalid AJAX request', $this );
		}

		$defaults = array(
			'priv'         => null,
			'name'         => $params->method,
			'custom_nonce' => null,
		);

		$method = (object) array_merge( $defaults, (array) $methods[ $params->method ] );

		if ( true !== $method->custom_nonce && ( ! isset( $params->_wpnonce ) || false === wp_verify_nonce( $params->_wpnonce, 'pods-' . $params->method ) ) ) {
			pods_error( __( 'Unauthorized request', 'pods' ), $this );
		}

		// Cleaning up $params
		unset( $params->action );
		unset( $params->method );

		if ( true !== $method->custom_nonce ) {
			unset( $params->_wpnonce );
		}

		// Check permissions (convert to array to support multiple)
		if ( ! empty( $method->priv ) && ! pods_is_admin( array( 'pods' ) ) && true !== $method->priv && ! pods_is_admin( $method->priv ) ) {
			pods_error( __( 'Access denied', 'pods' ), $this );
		}

		$params->method = $method->name;

		$method_name = $method->name;

		$params = apply_filters( "pods_api_{$method_name}", $params, $method );

		$api = pods_api();

		$api->display_errors = false;

		if ( 'upgrade' === $method->name ) {
			$output = (string) pods_upgrade( $params->version )->ajax( $params );
		} elseif ( 'migrate' === $method->name ) {
			$output = (string) apply_filters( 'pods_api_migrate_run', $params );
		} else {
			if ( ! method_exists( $api, $method->name ) ) {
				pods_error( 'API method does not exist', $this );
			} elseif ( 'save_pod' === $method->name ) {
				if ( isset( $params->field_data_json ) && is_array( $params->field_data_json ) ) {
					$params->fields = $params->field_data_json;

					unset( $params->field_data_json );

					foreach ( $params->fields as $k => $v ) {
						if ( empty( $v ) ) {
							unset( $params->fields[ $k ] );
						} elseif ( ! is_array( $v ) ) {
							$params->fields[ $k ] = (array) @json_decode( $v, true );
						}
					}
				}
			}

			// Dynamically call the API method
			$params = (array) $params;

			$output = call_user_func( array( $api, $method->name ), $params );
		}//end if

		// Output in json format
		if ( false !== $output ) {

			/**
			 * Pods Admin AJAX request was successful
			 *
			 * @since  2.6.8
			 *
			 * @param array               $params AJAX parameters.
			 * @param array|object|string $output Output for AJAX request.
			 */
			do_action( "pods_admin_ajax_success_{$method->name}", $params, $output );

			if ( is_array( $output ) || is_object( $output ) ) {
				wp_send_json( $output );
			} else {
				// @codingStandardsIgnoreLine
				echo $output;
			}
		} else {
			pods_error( 'There was a problem with your request.' );
		}//end if

		die();
		// KBAI!
	}
550368
function ajax(opts, cb) {
            opts = opts || {};
            var xmlhttp;

            if (typeof window === 'undefined') {
                // TODO: refactor node usage to live in here
                return cb();
            }

            if (window.XMLHttpRequest) {
                // code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            } else {
                // code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }

            xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                    cb(xmlhttp.responseText);
                }
            };

            xmlhttp.open(opts.method, opts.url, true);
            xmlhttp.send();
            return xmlhttp;
        }
915863
public function ajax_register() {
		if ( AjaxBase::is_ajax() ) {
			foreach ( $this->ajax_controllers as $class_name ) {
				/** @var AjaxBase $instance */
				$instance = $class_name::get_instance();
				$instance->register();
			}
		}
	}
792491
function(a) {
		gui.Spirit.prototype.onaction.call(this, a);
		this.action.$handleownaction = false;
		switch (a.type) {
			case gui.$ACTION_XFRAME_VISIBILITY:
				this._waiting = false;
				if (gui.hasModule("gui-layout@wunderbyte.com")) { // TODO: - fix
					if (a.data === true) {
						this.visibility.on();
					} else {
						this.visibility.off();
					}
				}
				a.consume();
				break;
		}
	}
1241555
def fire_action_event
      if header_row?
        if @table_row_sorter
          x = _convert_curpos_to_column
          c = @chash[x]
          # convert to index in data model since sorter only has data_model
          index = c.index
          @table_row_sorter.toggle_sort_order index
          @table_row_sorter.sort
          fire_dimension_changed
        end
      end
      super
    end
254774
function Action(name) {
    Action.super_.call(this);
    this.id = ActionUniqueId();
    this.set('ActionID', this.id);
    this.set('Action', name);
}
522876
function () {
		var ajax = this.obj.$ajax;
		var self = this;
		var version = this.obj.getUserData(0, "version");
		var url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + version].join("&");
		url = url.replace("editing=true&", "");
		this.getUpdates(url, function (xml) {
			var vers = ajax.xpath("//userdata", xml);
			self.obj.setUserData(0, "version", self._v(vers[0]));

			var upds = ajax.xpath("//update", xml);
			if (upds.length) {
				self._silent_mode = true;

				for (var i = 0; i < upds.length; i++) {
					var status = upds[i].getAttribute('status');
					var id = upds[i].getAttribute('id');
					var parent = upds[i].getAttribute('parent');
					switch (status) {
						case 'inserted':
							self.callEvent("insertCallback", [upds[i], id, parent]);
							break;
						case 'updated':
							self.callEvent("updateCallback", [upds[i], id, parent]);
							break;
						case 'deleted':
							self.callEvent("deleteCallback", [upds[i], id, parent]);
							break;
					}
				}

				self._silent_mode = false;
			}

			self._update_busy = false;
			self = null;
		});
	}