Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
improve datamodal
Browse files Browse the repository at this point in the history
documentation datamodal
  • Loading branch information
fherryfherry committed May 5, 2017
1 parent b4446a0 commit 2fb379d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/en/form-datamodal.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ Showing popup that contains a data table that you can choose

## Code Example
```php
$this->form[] = ['label'=>'Product Name','name'=>'products_id','type'=>'datamodal','datamodal_table'=>'products','datamodal_where'=>'','datamodal_columns'=>'name,description,price','datamodal_size'=>'large','required'=>true];
$this->form[] = ['label'=>'Product Name','name'=>'products_id','type'=>'datamodal','datamodal_table'=>'products','datamodal_where'=>'','datamodal_columns'=>'name,description,price','datamodal_columns_alias'=>'Name,Description,Price','required'=>true];
```
## Legend
| Attribute Name | Example | Description
| -------------- | ----------- | --------- |
| datamodal_table | E.g : `products` | Table name |
| datamodal_table (Required) | E.g : `products` | Table name |
| datamodal_columns (Required) | E.g : `name,description,price` | fields name to show. sparate with comma |
| datamodal_columns_alias (Required) | E.g : `Name,Description,Price` | alias of fields |
| datamodal_where | E.g : `id != 1` | Sql query where |
| datamodal_columns | E.g : `name,description,price` | fields name to show. sparate with comma |
| datamodal_size | E.g : `large` or `default` | popup size |

## What's Next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<?php
$name = Request::get('name_column');
$coloms_alias = explode(',','ID,'.Request::get('columns_name_alies'));
$coloms_alias = explode(',','ID,'.Request::get('columns_name_alias'));
if(count($coloms_alias)<2){
$coloms_alias=$columns ;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>

<script type="text/javascript">
var url_{{$name}} = "{{CRUDBooster::mainpath('modal-data')}}?table={{$form['datamodal_table']}}&columns=id,{{$form['datamodal_columns']}}&name_column={{$name}}&where={{urlencode($form['datamodal_where'])}}&select_to={{ urlencode($form['datamodal_select_to']) }}&columns_name_alies={{ urlencode($form['datamodal_columns_alias_name']) }}";
var url_{{$name}} = "{{CRUDBooster::mainpath('modal-data')}}?table={{$form['datamodal_table']}}&columns=id,{{$form['datamodal_columns']}}&name_column={{$name}}&where={{urlencode($form['datamodal_where'])}}&select_to={{ urlencode($form['datamodal_select_to']) }}&columns_name_alias={{ urlencode($form['datamodal_columns_alias']) }}";
function showModal{{$name}}() {
$('#iframe-modal-{{$name}}').attr('src',url_{{$name}});
Expand Down

0 comments on commit 2fb379d

Please sign in to comment.