Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filterType and filterOptions property for Column #630

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions Builder/Admin/FiltersBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,31 @@ protected function findColumns()
)
)
);

$column->setFormType(
$this->getFieldGuesser()->getFilterType(
$column->getDbType(),
$columnName
$this->getFieldOption(
$column,
'filterType',
$this->getFieldGuesser()->getFilterType(
$column->getDbType(),
$columnName
)
)
);

$column->setFormOptions(
$this->getFieldGuesser()->getFilterOptions(
$column->getFormType(),
$column->getDbType(),
$columnName
$this->getFieldOption(
$column,
'filterOptions',
$this->getFieldGuesser()->getFilterOptions(
$column->getFormType(),
$column->getDbType(),
$columnName
)
)
);

//Set the user parameters
// Set the user parameters
$this->setUserColumnConfiguration($column);

$this->addColumn($column);
Expand Down
24 changes: 24 additions & 0 deletions Generator/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class Column

protected $formOptions = array();

protected $filterType;

protected $filterOptions = array();

protected $getter;

protected $label = null;
Expand Down Expand Up @@ -158,6 +162,16 @@ public function getFormType()
return $this->formType;
}

public function setFilterType($filterType)
{
$this->filterType = $filterType;
}

public function getFilterType()
{
return $this->filterType;
}

public function setFormOptions($formOptions)
{
$this->formOptions = $formOptions;
Expand All @@ -168,6 +182,16 @@ public function getFormOptions()
return $this->formOptions;
}

public function setFilterOptions($filterOptions)
{
$this->filterOptions = $filterOptions;
}

public function getFilterOptions()
{
return $this->filterOptions;
}

public function setCredentials($credentials)
{
$this->credentials = $credentials;
Expand Down