Initialize column with delete buttons.

@param string $field
960817
public function init_delete($field)
    {
        // set special CSS class for delete buttons to add some styling
        $this->columns[$field]['button_class'] = 'atk-effect-danger atk-delete-button';
        $this->columns[$field]['icon'] = 'trash';

        // if this was clicked, then delete record
        if ($id = $_GET[$this->name.'_'.$field]) {

            // delete record
            $this->_performDelete($id);

            // show message
            $this->js()->univ()
                ->successMessage('Deleted Successfully')
                ->reload()
                ->execute();
        }

        // move button column at the end (to the right)
        $self = $this;
        $this->app->addHook('post-init', function () use ($self, $field) {
            if ($self->hasColumn($field)) {
                $self->addOrder()->move($field, 'last')->now();
            }
        });

        // ask for confirmation
        $this->init_confirm($field);
    }
1286455
public function removeTotalRow($field = null)
    {
        if ($field) {
            if (isset($this->totalRow[$field])) {
                unset($this->totalRow[$field]);
            }
        } else {
            $this->totalRow = array();
        }
    }
1097451
public function exclude($field)
    {
        $fields = (is_array($field) ? $field : func_get_args());

        foreach ($fields as $field) {
            $this->fields[$field] = -1;
        }
    }
229839
protected function _process_column($field)
	{
		return $this->db->escape_identifiers($field['name'])
			.' '.$field['type'].$field['length']
			.$field['null']
			.$field['unique']
			.$field['auto_increment'];
	}
397793
private function Initialize()
    {
        if (!$this->initialized)
        {
            $schema = $this->GetSchema();
            $t = $schema->Table();
            $sql = $schema->SqlBuilder();
           
            $what = $t->ToSelectList();
            $where = $sql->Equals($t->Field($schema->KeyField()), $sql->Value($this->KeyValue()));
            $select = $sql->Select(false, $what, $t, $where);
            $reader = $schema->Connection()->ExecuteQuery((string)$select);
            if ($reader->Read())
                $this->InitFromReader($reader);

            $reader->Close();
        }
    }
527420
public function initialize()
    {
        parent::initialize();

        $this->setHtmlAttribute('data-type', 'range');
        $this->setHtmlAttribute('class', 'column-filter');

        $this->getFrom()->initialize();
        $this->getTo()->initialize();

        $this->getFrom()->removeHtmlAttribute('data-type');
        $this->getTo()->removeHtmlAttribute('data-type');
    }
218903
def OnDeleteCols(self, event):
        """"""

        bbox = self.grid.selection.get_bbox()

        if bbox is None or bbox[1][1] is None:
            # Insert rows at cursor
            del_point = self.grid.actions.cursor[1]
            no_cols = 1
        else:
            # Insert at right edge of bounding box
            del_point = bbox[0][1]
            no_cols = self._get_no_rowscols(bbox)[1]

        with undo.group(_("Delete columns")):
            self.grid.actions.delete_cols(del_point, no_cols)

        self.grid.GetTable().ResetView()

        # Update the default sized cell sizes
        self.grid.actions.zoom()

        event.Skip()
635053
protected function updateFormField($field)
    {
        parent::updateFormField($field);

        if (is_numeric($this->MinLength) && $this->MinLength > 0) {
            $field->setAttribute('data-rule-minlength', intval($this->MinLength));
        }

        if (is_numeric($this->MaxLength) && $this->MaxLength > 0) {
            if ($field instanceof TextField) {
                $field->setMaxLength(intval($this->MaxLength));
            }
            $field->setAttribute('data-rule-maxlength', intval($this->MaxLength));
        }

        if ($this->Autocomplete) {
            $field->setAttribute('autocomplete', $this->Autocomplete);
        }
    }
487625
public function updateField($field)
    {
        if (!$field instanceof ObjectField)
        {
            throw new FieldEditorException(print_r($field, true) . " is not of type ObjectField");
        }
        foreach ($this->_fields as $column => $fields)
        {
            foreach ($fields as $index => $f)
            {
                $existing_field = $f->getField();
                if ($existing_field !== null && $field->getField() === $existing_field)
                {
                    // If the field name (f1234) exists merge replace on that.
                    $this->_fields[$column][$index] = $field;
                    return;
                }
            }
        }
        throw new FieldEditorException("Could not find an existing field: {$field->getField()} in this Section");
    }
368410
protected function _initFields() {
        foreach ($this->_fieldMeta as $k => $v) {
            $this->fieldNames[$k]= $this->xpdo->escape($this->_table) . '.' . $this->xpdo->escape($k);
        }
    }
829666
public function deleteCustomField(Field $field)
		{
			$form_data = array(
				'fieldname' => $field->getName()
			);
			$this->call('customfielddelete', $form_data);

			return TRUE;
		}
1249626
protected function initialize(array $fields)
    {
        $this->content = new Content;
        $this->revision = new Revision;

        foreach ($fields as $field => $settings) {
            $this->data[$field] = $this->initializeField($field, $settings);
        }
    }
112341
public function deleteRecord($tableName, $value, $field)
    {
        $query = SQLEncoder::encodeDeleteRecord($tableName, $value, $field);
        $this->con->query($query);
    }
959518
public function removeField($field)
    {
        $this->checkValidLoader();

        if (in_array($field, $this->loaders[ $this->contextLoader ])) {
            array_splice(
                $this->loaders[ $this->contextLoader ],
                array_search($field, $this->loaders[ $this->contextLoader ])
            );
        }

        return $this;
    }
632550
public function delete(CustomField $customField): void
    {
        $id = $customField->getId();

        $customField->setId(null);

        $this->client->delete($this->prepareUrlForKey('delete-custom-field', ['id' => $id]));
    }
1237867
protected function setSubmittedList($field)
    {
        $value = $this->getSubmitted($field);

        if (isset($value)) {
            $this->setSubmitted($field, $this->explodeList($value));
        }
    }
682058
public function unsetData ($field = null)
		{
			if ($field) {
				unset($this->viewData[$field]);
			} else {
				$this->viewData = array();
			}

			return $this;
		}