Skip to content

Commit

Permalink
changed docs for new ActiveWindowFromWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Aug 5, 2018
1 parent 52c5739 commit c81ccd9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
8 changes: 4 additions & 4 deletions docs/guide/lesson-activewindow.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ In our view we will include an overview of all contacts in the group, similar to

```php
<?php
use luya\admin\ngrest\aw\CallbackFormWidget;
use luya\admin\ngrest\aw\ActiveWindowFormWidget;
?>
<h4>Group Contacts</h4>
<table class="striped">
Expand All @@ -138,7 +138,7 @@ use luya\admin\ngrest\aw\CallbackFormWidget;
<h4>Send email</h4>
<p>Write an email to all contacts in this group.</p>

<?php $form = CallbackFormWidget::begin([
<?php $form = ActiveWindowFormWidget::begin([
'callback' => 'send-mail',
'buttonValue' => 'Send',
'options' => ['closeOnSuccess' => true]
Expand All @@ -148,9 +148,9 @@ use luya\admin\ngrest\aw\CallbackFormWidget;
<?php $form::end(); ?>
```

As you can see, we have used the [CallbackFormWidget](https://luya.io/api/luya-admin-ngrest-aw-CallbackFormWidget). Besides the [CallbackButtonWidget](https://luya.io/api/luya-admin-ngrest-aw-CallbackButtonWidget) it is mostly what you will need to create a simple ActiveWindow with additional functionality.
As you can see, we have used the {{luya\admin\ngrest\aw\ActiveWindowFormWidget}}. Besides the {{luya\admin\ngrest\aw\CallbackButtonWidget}} it is mostly what you will need to create a simple ActiveWindow form with additional functionality.

We configured the *CallbackFormWidget* to use our defined callback function in the ActiveWindow class and show a button label. We have also used the option to close the ActiveWindow when receiving a success message from the callback.
We configured the widget to use our defined callback function in the ActiveWindow class and show a button label. We have also used the option to close the ActiveWindow when receiving a success message from the callback.

## Result

Expand Down
25 changes: 13 additions & 12 deletions docs/guide/ngrest-activewindow.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ You can also use the callback from the widget to create a form sending data to a

```php
<?php
use luya\admin\ngrest\aw\CallbackFormWidget;
use luya\admin\ngrest\aw\ActiveWindowFormWidget;

/* @var $this \luya\admin\ngrest\base\ActiveWindowView */
/* @var $this \luya\admin\ngrest\aw\CallbackFormWidget */
/* @var $form \luya\admin\ngrest\aw\ActiveWindowFormWidget */

?>
<div>
<?php $form = CallbackFormWidget::begin(['callback' => 'post-data', 'buttonValue' => 'Submit']); ?>
<?php $form = ActiveWindowFormWidget::begin(['callback' => 'post-data', 'buttonValue' => 'Submit']); ?>
<?= $form->field('firstname', 'Firstname'); ?>
<?= $form->field('password', 'Password')->passwordInput(); ?>
<?= $form->field('message', 'Message')->textarea(); ?>
Expand Down Expand Up @@ -147,7 +147,7 @@ When working with angular you might want to trigger some of the functions of the
|Function|Description
|--------|-----------
|`$scope.$parent.closeActiveWindow()`|Close the current ActiveWindow
|`$scope.$parent.loadList()`|Reload the active window list.
|`$scope.$parent.loadList()`|Reload the ActiveWindow list.
|`$scope.$parent.reloadActiveWindow()`|Reload (Rerender) the ActiveWindow.
|`$scope.$parent.toast.error(message)`|Display an error toast message.
|`$scope.$parent.toast.success(message)`|Display a success toast message.
Expand All @@ -156,12 +156,13 @@ When working with angular you might want to trigger some of the functions of the
## Existing reusable ActiveWindows
The admin UI of LUYA provides some basic reusable ActiveWindows which you can reuse and use out of the box. Just attach them to your NgRest config and maybe adjust some properties.
The admin UI of LUYA provides some basic reusable ActiveWindows which you can reuse and use out of the box. Just attach them to your NgRest config with the given configuration. Take a look at the API reference for more details in how to attach the specific ActiveWindow.
|Name |Class |Public Properties
|-- |-- |--
|Tag |{{\luya\admin\aws\TagActiveWindow}}|<ul><li>$tableName</li></ul>
|Image collection selector from File Manager|{{\luya\admin\aws\ImageSelectCollectionActiveWindow}}|<ul><li>$refTableName</li><li>$imageIdFieldName</li><li>$refFieldName</li></ul>
|Change password|{{\luya\admin\aws\ChangePasswordActiveWindow}}|<ul><li>$className</li></ul>
|Coordinates collector|{{\luya\admin\aws\CoordinatesActiveWindow}}|<ul><li>$ampsApikey</li></ul>
|Image collection uploader with Flow|{{\luya\admin\aws\FlowActiveWindow}}|<ul><li>$modelClass</li></ul>
|Class|Description
|--|--|
|{{\luya\admin\aws\TagActiveWindow}}|Provides the option to set tags for the given record.
|{{\luya\admin\aws\ImageSelectCollectionActiveWindow}}|Select images from the file manager and store them in a reference table.
|{{\luya\admin\aws\FlowActiveWindow}}|Provides an image uploader (flow uploader) which are hidden in the filemanager and stored in a reference table.
|{{\luya\admin\aws\DetailViewActiveWindow}}|A detail view where you can define the attributes with the given type or just print all fields with the corresponding value.
|{{\luya\admin\aws\ChangePasswordActiveWindow}}|An option to change the password.
|{{\luya\admin\aws\CoordinatesActiveWindow}}|Provides a view where you can find coordinates for a given location.

0 comments on commit c81ccd9

Please sign in to comment.