Skip to content

Commit

Permalink
Typo fixes in docs (contributte#1088)
Browse files Browse the repository at this point in the history
* Fixed typos in columns.md

* Fixed typos in actions.md

* Update data-source.md

* Fixed typos in export.md

* Fixed typos, missing/redundant words in filters.md

* Update columns.md

* Fixed typos group-action.md

* Fixed typo inline-edit.md

* Fixed missin comma localization.md

* Fixed typos row.md

* Add support for `nette/utils` version `4.0.0` (contributte#1086)

* Update .docs/export.md

Co-authored-by: Radim Vaculík <radim.vaculik@gmail.com>

---------

Co-authored-by: Dominik Harmim <harmim6@gmail.com>
Co-authored-by: Radim Vaculík <radim.vaculik@gmail.com>
  • Loading branch information
3 people authored and MrVoltz committed Feb 2, 2024
1 parent bceb3eb commit 5084daf
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 128 deletions.
40 changes: 20 additions & 20 deletions .docs/actions.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Table of contents

- [Actions](#actions)
- [Api](#api)
- [Parameters](#parameters)
- [Icon](#icon)
- [Class](#class)
- [Title](#title)
- [Confirmation](#confirmation)
- [Ajax](#ajax)
- [Redrawing the data](#redrawing-the-data)
- [Redrawing one row](#redrawing-one-row)
- [Sortable](#sortable)
- [Sorting handler](#sorting-handler)
- [MultiAction](#multiaction)
- [Item detail](#item-detail)
- [Item detail form](#item-detail-form)
- [Item detail template variables](#item-detail-template-variables)
- [Item detail render condition](#item-detail-render-condition)
- [ActionCallback](#actioncallback)
- [Toolbar button](#toolbar-button)
- [Api](#api)
- [Parameters](#parameters)
- [Icon](#icon)
- [Class](#class)
- [Title](#title)
- [Confirmation](#confirmation)
- [Ajax](#ajax)
- [Redrawing the data](#redrawing-the-data)
- [Redrawing one row](#redrawing-one-row)
- [Sortable](#sortable)
- [Sorting handler](#sorting-handler)
- [MultiAction](#multiaction)
- [Item detail](#item-detail)
- [Item detail form](#item-detail-form)
- [Item detail template variables](#item-detail-template-variables)
- [Item detail render condition](#item-detail-render-condition)
- [ActionCallback](#actioncallback)
- [Toolbar button](#toolbar-button)

# Actions

Expand Down Expand Up @@ -242,7 +242,7 @@ The name of the handler used for sorting can be changed:
$grid->setSortableHandler('foo!');
```

Also when you are using datagrid in component, you have to alter the name a bit:
Also, when you are using datagrid in component, you have to alter the name a bit:

```php
$grid->setSortableHandler('myComponent:sort!');
Expand All @@ -261,7 +261,7 @@ $grid->addMultiAction('multi_action', 'MultiAction')
->addAction('blah2', 'Blahblah2', 'blah!', ['name']);
```

Sure you can alter multiaction class, icons, etc. Same you can change icon, class, etc of nested actions:
Sure you can alter multiaction class, icons, etc. Same you can change icon, class, etc. of nested actions:

```php
$grid->getAction('multi_blah')
Expand Down
82 changes: 41 additions & 41 deletions .docs/columns.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
Table of contents

- [Columns](#columns)
- [Api](#api)
- [Parameters](#parameters)
- [Templates](#templates)
- [Renderers](#renderers)
- [Replacement](#replacement)
- [Escaping values](#escaping-values)
- [Sorting](#sorting)
- [Resetting pagination after sorting](#resetting-pagination-after-sorting)
- [Default sort](#default-sort)
- [Resetting default sort](#resetting-default-sort)
- [Multiple columns sort](#multiple-columns-sort)
- [Default per page](#default-per-page)
- [Custom sorting Callback](#custom-sorting-callback)
- [Align](#align)
- [Removing column](#removing-column)
- [Column Text](#column-text)
- [Column Number](#column-number)
- [Column DateTime](#column-datetime)
- [Column Link](#column-link)
- [Open in new tab](#open-in-new-tab)
- [Column Status](#column-status)
- [Hideable columns](#hideable-columns)
- [Default hide](#default-hide)
- [Columns Summary](#columns-summary)
- [Aggregation Function](#aggregation-function)
- [Single column](#single-column)
- [Multiple columns](#multiple-columns)
- [Column \(th&gt;, td&gt;\) attributes](#column-th-td-attributes)
- [Column callback](#column-callback)
- [Api](#api)
- [Parameters](#parameters)
- [Templates](#templates)
- [Renderers](#renderers)
- [Replacement](#replacement)
- [Escaping values](#escaping-values)
- [Sorting](#sorting)
- [Resetting pagination after sorting](#resetting-pagination-after-sorting)
- [Default sort](#default-sort)
- [Resetting default sort](#resetting-default-sort)
- [Multiple columns sort](#multiple-columns-sort)
- [Default per page](#default-per-page)
- [Custom sorting Callback](#custom-sorting-callback)
- [Align](#align)
- [Removing column](#removing-column)
- [Column Text](#column-text)
- [Column Number](#column-number)
- [Column DateTime](#column-datetime)
- [Column Link](#column-link)
- [Open in new tab](#open-in-new-tab)
- [Column Status](#column-status)
- [Hideable columns](#hideable-columns)
- [Default hide](#default-hide)
- [Columns Summary](#columns-summary)
- [Aggregation Function](#aggregation-function)
- [Single column](#single-column)
- [Multiple columns](#multiple-columns)
- [Column \(th&gt;, td&gt;\) attributes](#column-th-td-attributes)
- [Column callback](#column-callback)

# Columns

Expand All @@ -39,7 +39,7 @@ There are several column classes and they all have some common behaviour and pro

### Parameters

Lets add a simple text column like we've done before:
Let's add a simple text column like we've done before:

```php
$grid->addColumnText('name', 'Name');
Expand All @@ -55,7 +55,7 @@ $grid->addColumnText('name3', 'Name', 'name');

### Templates

Column may have it's own template. I will add one more parameter (optional) to the method `::setTemplate()`, just for fun:
Columns may have it's own template. I will add one more parameter (optional) to the method `::setTemplate()`, just for fun:

```php
$grid->addColumnText('name', 'Name')
Expand All @@ -76,7 +76,7 @@ $grid->addColumnText('name', 'Name')
});
```

But hey, what if i want to replace **just some** rows? No problem, the second optional argument tells me (callback again) whether the datagrid should use your renderer or not. Example:
But hey, what if I want to replace **just some** rows? No problem, the second optional argument tells me (callback again) whether the datagrid should use your renderer or not. Example:

```php
$grid->addColumnText('name', 'Name')
Expand Down Expand Up @@ -117,7 +117,7 @@ $grid->addColumnText('name', 'Name')
->setSortable();
```

When using doctrine as data source, you can output data the object way using dot-notaion and property accessor. But when you are using collumn of related table for sorting, you probably want to use alias for sorting:
When using doctrine as data source, you can output data the object way using dot-notation and property accessor. But when you are using column of related table for sorting, you probably want to use alias for sorting:

```php
$grid->addColumnText('role', 'User role', 'role.name')
Expand Down Expand Up @@ -150,7 +150,7 @@ $grid->setDefaultSort(['id' => 'DESC'], FALSE);

### Multiple columns sort

Sorting by multiple columns is disabled by default. But can be enaled:
Sorting by multiple columns is disabled by default. But can be enabled:

```php
$grid->setMultiSortEnabled($enabled = TRUE); // Pass FALSE to disable
Expand Down Expand Up @@ -266,7 +266,7 @@ $grid->addColumnLink('name', 'Name', 'edit')
![Status 1](https://github.com/contributte/datagrid/blob/master/.docs/assets/status1.gif?raw=true)
![Status 1](https://github.com/contributte/datagrid/blob/master/.docs/assets/status2.gif?raw=true)

Once your item keep some "status" flag, it is appropriate to show user the status in highlighted form. Also there could be a dropdown with available statuses:
Once your item keep some "status" flag, it is appropriate to show user the status in highlighted form. Also, there could be a dropdown with available statuses:

```php
$grid->addColumnStatus('status', 'Status')
Expand Down Expand Up @@ -347,7 +347,7 @@ $grid->getColumn('status')->getOption(2)

![Columns Hiding](https://github.com/contributte/datagrid/blob/master/.docs/assets/hideable_columns.gif?raw=true)

In example datargid above, you can hide columns and then reveal them again. This feature is disabled by default. You can enable it like this:
In example datagrid above, you can hide columns and then reveal them again. This feature is disabled by default. You can enable it like this:

```php
$grid->setColumnsHideable();
Expand All @@ -370,7 +370,7 @@ If default hide is used, new button is shown in that settings (gear) dropdown -

## Columns Summary

Datagrid implements a feature that allows you to display **sum** of column of displayed items at the bootom of the grid. Try it out:
Datagrid implements a feature that allows you to display **sum** of column of displayed items at the bottom of the grid. Try it out:

```php
$grid->addColumnNumber('in', 'Income')
Expand Down Expand Up @@ -426,7 +426,7 @@ As mentioned above, there is one aggregation function prepared: `Contributte\Dat

### Multiple columns

In case you want to make the aggreagation directly using SQL by your domain, you will probably use interface `IMultipleAggregationFunction` (instead of `ISingleColumnAggregationFunction`):
In case you want to make the aggregation directly using SQL by your domain, you will probably use interface `IMultipleAggregationFunction` (instead of `ISingleColumnAggregationFunction`):

```php
$grid->setMultipleAggregationFunction(
Expand Down Expand Up @@ -476,7 +476,7 @@ $grid->setMultipleAggregationFunction(
);
```

This aggregatin is used along with `Dibi` in the demo.
This aggregating is used along with `Dibi` in the demo.

## Column (th&gt;, td&gt;) attributes

Expand All @@ -499,7 +499,7 @@ $grid->addColumnText('name', 'Name')

## Column callback

When you need to modify columns just before rendering (meybe remove some status options or completely change renderer for partucular items), you can create column callback, that will be called with `$column` and `$item` in parameter:
When you need to modify columns just before rendering (maybe remove some status options or completely change renderer for particular items), you can create column callback, that will be called with `$column` and `$item` in parameter:

```php
$grid->addColumnLink('link', 'Link', 'this#demo', 'name', ['id', 'surname' => 'name']);
Expand Down Expand Up @@ -531,7 +531,7 @@ $grid->addColumnCallback('link', function($column, $item) {
});
```

That is the code of the demove shown above. As you can see, item with id == 1 does have a empty link column and only 2 options in `ColumnStatus`.
That is the code of the demo shown above. As you can see, item with id == 1 does have an empty link column and only 2 options in `ColumnStatus`.


```php
Expand Down
12 changes: 6 additions & 6 deletions .docs/data-source.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Table of contents

- [Data sources](#data-sources)
- [ORM Relations](#orm-relations)
- [ApiDataSource](#apidatasource)
- [NextrasDataSource](#nextrasdatasource)
- [NetteDatabaseTableDataSource](#nettedatabasetabledatasource)
- [ORM Relations](#orm-relations)
- [ApiDataSource](#apidatasource)
- [NextrasDataSource](#nextrasdatasource)
- [NetteDatabaseTableDataSource](#nettedatabasetabledatasource)

# Data sources

Expand Down Expand Up @@ -44,7 +44,7 @@ Once you have set a data source, you can add columns to the datagrid.

## ORM Relations

When you are using for example Doctrine as a data source, you can easily access another related entites for rendering in column. Let's say you have an entity `User` and each instance can have a property `$name` and `$grandma`. `$grandma` is also an instance of `User` class. Displaying people and their grandmas is very simple then - just use this dot notation:
When you are using for example Doctrine as a data source, you can easily access another related entities for rendering in column. Let's say you have an entity `User` and each instance can have a property `$name` and `$grandma`. `$grandma` is also an instance of `User` class. Displaying people and their grandmas is very simple then - just use this dot notation:

```php
$grid->addColumnText('name', 'Name', 'name');
Expand All @@ -67,7 +67,7 @@ The idea is simply to forward filtering/sorting/limit/... to remote api. Feel fr

## NextrasDataSource

There is one specific behaviour when using Netras ORM. When custom filter conditions are used, user has to work not with given `Collection` instance, but with `Collection::getQueryBuilder()`. That snippet of code will not work correctly, because `DbalCollection` calls clone on each of it's methods:
There is one specific behaviour when using Nextras ORM. When custom filter conditions are used, user has to work not with given `Collection` instance, but with `Collection::getQueryBuilder()`. That snippet of code will not work correctly, because `DbalCollection` calls clone on each of it's methods:

```php
$grid->getFilter('name')
Expand Down
14 changes: 7 additions & 7 deletions .docs/export.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Table of contents

- [Exports](#exports)
- [ExportCallback](#exportcallback)
- [CSV export](#csv-export)
- [\(Not\) Using templates in CSV export](#not-using-templates-in-csv-export)
- [Export columns](#export-columns)
- [Export encoding, delimiter](#export-encoding-delimiter)
- [ExportCallback](#exportcallback)
- [CSV export](#csv-export)
- [\(Not\) Using templates in CSV export](#not-using-templates-in-csv-export)
- [Export columns](#export-columns)
- [Export encoding, delimiter](#export-encoding-delimiter)

# Exports

Expand Down Expand Up @@ -38,11 +38,11 @@ $grid->addExportCsv('Csv export (filtered)', 'examples.csv')

### (Not) Using templates in CSV export

ExportCsv ignores column template, because i don't like the idea Latte (tempalting engine for HTML) exporting data for CSV format. Using custom renderer sounds better to me in that case.
ExportCsv ignores column template, because i don't like the idea Latte (templating engine for HTML) exporting data for CSV format. Using custom renderer sounds better to me in that case.

## Export columns

When you exporting the data, you can have different columns in export and in the datagrid. Or differently rendered. So there is another method `Contributte\Datagrid\Export\Export::setColumns()`. You can create instances of another columns and pass them in array to this method. These will be rendered in export:
When you're exporting the data, you can have different columns in export and in the datagrid. Or differently rendered. So there is another method `Contributte\Datagrid\Export\Export::setColumns()`. You can create instances of another columns and pass them in array to this method. These will be rendered in export:

```php
$column_name = new Contributte\Datagrid\Column\ColumnText($grid, 'name', 'name', 'Name');
Expand Down
50 changes: 25 additions & 25 deletions .docs/filters.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Table of contents

- [Filters](#filters)
- [Api](#api)
- [Placeholder](#placeholder)
- [Custom where condition](#custom-where-condition)
- [Templates:](#templates)
- [Filter blocks](#filter-blocks)
- [Filter type blocks](#filter-type-blocks)
- [Removing filter](#removing-filter)
- [FilterText](#filtertext)
- [FilterSelect](#filterselect)
- [FilterMultiSelect](#filtermultiselect)
- [FilterDate](#filterdate)
- [FilterRange](#filterrange)
- [FilterDateRange](#filterdaterange)
- [Default filter values](#default-filter-values)
- [Resetting filter to default values](#resetting-filter-to-default-values)
- [Filters rendering](#filters-rendering)
- [Outer filters rendering](#outer-filters-rendering)
- [Session - remeber state](#session---remeber-state)
- [Session - filters / filter values changed](#session---filters--filter-values-changed)
- [URL refreshing - history API](#url-refreshing---history-api)
- [Auto submit](#auto-submit)
- [Api](#api)
- [Placeholder](#placeholder)
- [Custom where condition](#custom-where-condition)
- [Templates:](#templates)
- [Filter blocks](#filter-blocks)
- [Filter type blocks](#filter-type-blocks)
- [Removing filter](#removing-filter)
- [FilterText](#filtertext)
- [FilterSelect](#filterselect)
- [FilterMultiSelect](#filtermultiselect)
- [FilterDate](#filterdate)
- [FilterRange](#filterrange)
- [FilterDateRange](#filterdaterange)
- [Default filter values](#default-filter-values)
- [Resetting filter to default values](#resetting-filter-to-default-values)
- [Filters rendering](#filters-rendering)
- [Outer filters rendering](#outer-filters-rendering)
- [Session - remeber state](#session---remeber-state)
- [Session - filters / filter values changed](#session---filters--filter-values-changed)
- [URL refreshing - history API](#url-refreshing---history-api)
- [Auto submit](#auto-submit)

# Filters

Expand Down Expand Up @@ -218,7 +218,7 @@ $grid->addFilterDateRange('date_created', 'User registered:');

## Default filter values

Datagrid filters can have contain default filter values. Once user changes the filter, default values are not longer applied to the filter. Example usage:
Datagrid filters can have default filter values. Once user changes the filter, default values are no longer applied to the filter. Example usage:

```php
$grid->setDefaultFilter(['status' => 1, 'name' => 'Joe']);
Expand Down Expand Up @@ -270,21 +270,21 @@ $grid->setOuterFilterRendering(); // - that is true. Or $grid->setOuterFilterRen

## Session - remeber state

Grid refreshes its state on several levels. One could be session. It is by defaut turned on, but can be disabled:
Grid refreshes its state on several levels. One could be session. It is by default turned on, but can be disabled:

```php
$grid->setRememberState(false); // Or turned on again: $grid->setRememberState(true);
```

If you want to keep hideable columns in session even when rememebr state is turned off, use second argument:
If you want to keep hideable columns in session even when remember state is turned off, use second argument:

```php
$grid->setRememberState(false, true);
```

## Session - filters / filter values changed

When you set some filters and user do some filtering, values are stored in session. After that, when filters are changed (maybe some select options are removed, etc), datagrid would throw an exception, because it can not find particular filters / filter values that are still stored in session. You can supress those exception:
When you set some filters and user do some filtering, values are stored in session. After that, when filters are changed (maybe some select options are removed, etc.), datagrid would throw an exception, because it can not find particular filters / filter values that are still stored in session. You can suppress those exception:

```php
$grid->setStrictSessionFilterValues(false);
Expand Down
Loading

0 comments on commit 5084daf

Please sign in to comment.