Merge pull request #1749 from Flynsarmy/tableWidgetAlias

Remove brackets from DataTable's table widget
This commit is contained in:
Samuel Georges 2016-02-13 16:30:11 +11:00
commit da5ede06b5
1 changed files with 6 additions and 5 deletions

View File

@ -3,6 +3,7 @@
use Lang;
use Backend\Widgets\Table;
use Backend\Classes\FormWidgetBase;
use October\Rain\Html\Helper as HtmlHelper;
use ApplicationException;
/**
@ -106,8 +107,8 @@ class DataTable extends FormWidgetBase
*/
public function getSaveValue($value)
{
// TODO: provide a streaming implementation of saving
// data to the model. The current implementation returns
// TODO: provide a streaming implementation of saving
// data to the model. The current implementation returns
// all records at once. -ab
$dataSource = $this->table->getDataSource();
@ -133,7 +134,7 @@ class DataTable extends FormWidgetBase
{
$dataSource = $this->table->getDataSource();
// TODO: provide a streaming implementation of loading
// TODO: provide a streaming implementation of loading
// data from the model. The current implementation loads
// all records at once. -ab
@ -150,10 +151,10 @@ class DataTable extends FormWidgetBase
// It's safe to use the field name as an alias
// as field names do not repeat in forms. This
// approach lets to access the table data by the
// approach lets to access the table data by the
// field name in POST requests directly (required
// in some edge cases).
$config->alias = $this->fieldName;
$config->alias = studly_case(HtmlHelper::nameToId($this->fieldName)) . 'datatable';
$table = new Table($this->controller, $config);