-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
113 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace dimonka2\flatform\Form\Components; | ||
|
||
use dimonka2\flatform\Form\Contracts\IContext; | ||
use dimonka2\flatform\Form\Element; | ||
|
||
class DatatableDetails extends Element | ||
{ | ||
public const default_class = "dt-details"; | ||
public const default_data_id = "id"; | ||
public $url; | ||
public $data_definition; | ||
public $format_function; | ||
public $column_data; | ||
public $data_id; | ||
protected $ajax_method; | ||
|
||
protected function read(array $element) | ||
{ | ||
$this->readSettings($element, [ | ||
'url', | ||
'data_definition', // 'article_id: rowData.id,' | ||
'format_function', // myFormat(rowData); | ||
'ajax_method', | ||
'column_data', | ||
'data_id', | ||
]); | ||
parent::read($element); | ||
if(!$this->class ) $this->class = self::default_class; | ||
if(!$this->data_id ) $this->data_id = self::default_data_id; | ||
} | ||
|
||
/** | ||
* Get the value of ajax_method | ||
*/ | ||
public function getAjaxMethod() | ||
{ | ||
return $this->ajax_method ? $this->ajax_method : $this->parent->getAjaxMethod(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters