Sets the response element selector for Edit and Delete request with ajax
@param string|array $_targetSelector string or associative array ["edit"=>"edit_selector","delete"=>"delete_selector"]
@return DataTable
979355
public function setTargetSelector($_targetSelector) {
		if(!\is_array($_targetSelector)){
			$_targetSelector=["edit"=>$_targetSelector,"delete"=>$_targetSelector];
		}
		$this->_targetSelector=$_targetSelector;
		return $this;
	}
1225000
protected function getSelector(): DocumentSelector
    {
        if (empty($this->selector)) {
            //Requesting selector on demand
            $this->selector = $this->odm->selector($this->class);
        }

        return clone $this->selector;
    }
1215134
function selectorBlockHandler(element) {
    if (element.type === 'Selector') {
        const name = []
        let discard = false
        element.children.forEach(e => {
            switch (e.type) {
                case "ClassSelector":
                    name.push("." + e.name);
                    break;
                    //not support for now
                case "Combinator":
                    name.push(e.name);
                    discard = true
                    return null
                case "TypeSelector":
                    name.push(e.name);
                    break;
                case "IdSelector":
                    //not support for now
                    name.push("#" + e.name);
                    discard = true
                    return null
                case "WhiteSpace":
                    name.push(" ");
                    break
                default: {
                    // console.warn('unknown selector type:', e)
                    discard = true
                    return null
                }
            }
        })
        if (!discard)
            return name.join("")
        else return null
    }
}
162830
public static base_response delete(nitro_service client, String selectorname) throws Exception {
		cacheselector deleteresource = new cacheselector();
		deleteresource.selectorname = selectorname;
		return deleteresource.delete_resource(client);
	}
124191
public function getSelector()
	{
		$direct_settings = array(
			'className', 'css', 'id', 'linkText', 'name', 'partialLinkText', 'tagName', 'xpath', 'label',
		);

		foreach ( $direct_settings as $direct_setting ) {
			if ( $this->$direct_setting ) {
				return array($direct_setting => $this->$direct_setting);
			}
		}

		if ( $this->how && $this->using ) {
			if ( !in_array($this->how, $direct_settings) ) {
				throw new AnnotationException(
					"FindBy annotation expects 'how' to be one of \\QATools\\QATools\\PageObject\\How class constants",
					AnnotationException::TYPE_INCORRECT_USAGE
				);
			}

			return array($this->how => $this->using);
		}

		throw new AnnotationException(
			sprintf(
				"FindBy annotation requires one of '%s' or both 'how' and 'using' parameters specified",
				implode("', '", $direct_settings)
			),
			AnnotationException::TYPE_INCORRECT_USAGE
		);
	}
478429
public function setElementInsteadOf($targetName, $element, $name = null) {
		if (! isset($this->_elements[$targetName])) {
			return $this;
		}
		
		$elements = [];
		
		foreach ($this->_elements as $existsName => $existsElement) {
			
			if ($targetName === $existsName) {
				if ($name === null) {
					$elements[] = $element;
				} else {
					$elements[$name] = $element;
				}
			} else {
				$elements[$existsName] = $existsElement;
			}
		}
		
		$this->_elements = $elements;
		
		return $this;
	}
650035
function validateAndGetQuerySelector (selector) {
  try {
    var el = document.querySelector(selector);
    if (!el) {
      warn('No element was found matching the selector: "%s"', selector);
    }
    return el;
  } catch (e) {  // Capture exception if it's not a valid selector.
    warn('"%s" is not a valid selector', selector);
    return undefined;
  }
}
1161369
protected function getTable($selector) {
        $selector = $this->getSession()->getSelectorsHandler()->xpathLiteral($selector);
        $page = $this->getSession()->getPage();
        $candidates = $page->findAll(
            'xpath',
            $this->getSession()->getSelectorsHandler()->selectorToXpath(
                "xpath", ".//table[(./@id = $selector or  contains(./@title, $selector))]"
            )
        );

        // Find tables by a <caption> field
		$candidates += $page->findAll('xpath', "//table//caption[contains(normalize-space(string(.)), 
			$selector)]/ancestor-or-self::table[1]");

        // Find tables by a .title node
		$candidates += $page->findAll('xpath', "//table//*[@class='title' and contains(normalize-space(string(.)), 
			$selector)]/ancestor-or-self::table[1]");

        // Some tables don't have a visible title, so look for a fieldset with data-name instead
        $candidates += $page->findAll('xpath', "//fieldset[@data-name=$selector]//table");

        assertTrue((bool)$candidates, 'Could not find any table elements');

        $table = null;
        foreach($candidates as $candidate) {
            if(!$table && $candidate->isVisible()) {
                $table = $candidate;
            }
        }

        assertTrue((bool)$table, 'Found table elements, but none are visible');

        return $table;
    }
1100569
public function setSelector($selector) {
    
    $this->literalSelector = $selector;

    $this->selector = $selector;
    $this->selector = str_replace(':first', ':nth-of-type(1)', $this->selector);
    // nth-of-type is a NOT nice alias for eq but its 1-based (eq ist 0-based)
    // but its not the same! fix me!
    $this->selector = Preg::replace_callback(
      $this->selector, 
      '/:eq\(([0-9]+)\)/', 
      function ($m) { 
        return sprintf(':nth-of-type(%d)', $m[1]+1); 
      }
    );
    return $this;
  }
945594
function ajax_edit() {        
        $this->autoRender = false;
        $returnFlag = 1;

        if (!empty($this->request->data)) {
            if(isset($this->request->data['Mesa']['id'])) {
                if(($this->request->data['Mesa']['id'] != '') || ($this->request->data['Mesa']['id'] != null) || ($this->request->data['Mesa']['id'] != 0)) {
                    $this->Mesa->recursive = -1;
                    $this->Mesa->id = $this->request->data['Mesa']['id'];

                    foreach($this->request->data['Mesa'] as $field=>$valor):
                        if($field == 'id') continue;// el id no lo tengo que actualizar
                        $valor = (strtolower($valor) == 'now()') ? date('Y-m-d H:i:s') : $valor;
                        if (!$this->Mesa->saveField($field, $valor, $validate = true)) {
                            debug($this->Mesa->validationErrors);
                            throw new InternalErrorException("Error de Validacion al guardar");
                            
                            header("HTTP/1.0 500 Internal Server Error");
                            if($returnFlag == 1){
                                $returnFlag = 0;
                            }
                            $returnFlag--;
                        }
                    endforeach;
                }
            } else {
                throw new InternalErrorException("Id de Mesa vino vacio");
            }
        } else {
            throw new InternalErrorException("data vino vacio");
        }
        exit;
    }
1010598
function(selectors) {
		var curSelector;
		var elements;
		var attributeName;
		var attributeValue;
		var elementIndex;

		for(var selectorIndex = 0; selectorIndex < selectors.length; selectorIndex++) {
			curSelector = selectors[selectorIndex];
			elements = document.querySelectorAll(curSelector[0]);
			attributeName = 'data-' + curSelector[1];
			attributeValue = curSelector[2];

			if(!elements) {
				continue;
			}

			for(elementIndex = 0; elementIndex < elements.length; elementIndex++) {
				elements[elementIndex].setAttribute(attributeName, attributeValue);
			}
		}
	}
426412
public static base_responses delete(nitro_service client, String selectorname[]) throws Exception {
		base_responses result = null;
		if (selectorname != null && selectorname.length > 0) {
			cacheselector deleteresources[] = new cacheselector[selectorname.length];
			for (int i=0;i<selectorname.length;i++){
				deleteresources[i] = new cacheselector();
				deleteresources[i].selectorname = selectorname[i];
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}
775981
public function compileSelect()
    {

        // Compile "Select From"
        if (sizeof($this->query->getQuerySelect()) == 0) {
            $this->queryString = 'SELECT * ';

            return;
        }

        foreach ($this->query->getQuerySelect() as $key => $value) {
            if ($value instanceof Raw) {
                $value = $value->getString();
            }

            if ($key == 0) {
                $selectString = "$value";
            } else {
                $selectString .= ",$value";
            }
        }

        $this->queryString = "SELECT $selectString";
    }
335299
public function serializer(String $url, $selector = '.modal-body', $datatype = 'standart')
    {
        $selector = is_string($selector)
                  ? ($this->settings['attr']['data-target'] ?? NULL) . Base::prefix($selector, ' ')
                  : $selector;

        return $this->trigger('click', $url, $selector, $datatype, 'serializer');
    }
1206143
function remove($selector, $callbackOrName = true)
    {
        if (array_key_exists($selector, $this->filters)) {
            if ($callbackOrName === true) {
                unset($this->filters[$selector]);
            } else {
                if (! is_object($callbackOrName)) {
                    $filter = $this->filterFactory->createFilter($callbackOrName);
                } else {
                    $filter = $callbackOrName;
                }
                /* @var $filterSet FilterSet */
                $filterSet = $this->filters[$selector];
                $filterSet->remove($filter);
            }
        }
        return $this;
    }
289283
function() {
            var self            = this,
                target          = null,
                el              = null,
                dataset         = null,
                i               = -1;

            self.callActions('beforeIndexTargets', arguments);

            self.dom.targets = self.config.layout.allowNestedTargets ?
                self.dom.container.querySelectorAll(self.config.selectors.target) :
                h.children(self.dom.container, self.config.selectors.target, self.dom.document);

            self.dom.targets = h.arrayFromList(self.dom.targets);

            self.targets = [];

            if ((dataset = self.config.load.dataset) && dataset.length !== self.dom.targets.length) {
                throw new Error(mixitup.messages.errorDatasetPrerenderedMismatch());
            }

            if (self.dom.targets.length) {
                for (i = 0; el = self.dom.targets[i]; i++) {
                    target = new mixitup.Target();

                    target.init(el, self, dataset ? dataset[i] : void(0));

                    target.isInDom = true;

                    self.targets.push(target);
                }

                self.dom.parent = self.dom.targets[0].parentElement === self.dom.container ?
                    self.dom.container :
                    self.dom.targets[0].parentElement;
            }

            self.origOrder = self.targets;

            self.callActions('afterIndexTargets', arguments);
        }
258628
public function set($selector, $value)
    {
        $value = self::prepareToStore($value);

        // modify
        $arraySelector = explode('.', $selector);
        $chunksNum = count($arraySelector);

        // optimize one-level selector search
        if (1 == $chunksNum) {
            // update only if new value different from current
            if (!isset($this->data[$selector]) || $this->data[$selector] !== $value) {
                // modify
                $this->data[$selector] = $value;
                // mark field as modified
                $this->modifiedFields[] = $selector;
            }

            return $this;
        }

        // selector is nested
        $section = &$this->data;

        for ($i = 0; $i < $chunksNum - 1; $i++) {
            $field = $arraySelector[$i];

            if (!isset($section[$field])) {
                $section[$field] = array();
            } elseif (!is_array($section[$field])) {
                throw new Exception('Assigning sub-document to scalar value not allowed');
            }

            $section = &$section[$field];
        }

        // update only if new value different from current
        if (!isset($section[$arraySelector[$chunksNum - 1]]) || $section[$arraySelector[$chunksNum - 1]] !== $value) {
            // modify
            $section[$arraySelector[$chunksNum - 1]] = $value;
            // mark field as modified
            $this->modifiedFields[] = $selector;
        }

        return $this;
    }