-
Notifications
You must be signed in to change notification settings - Fork 14
Add DataCollection guides #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…aCollection methods
@@ -13,7 +13,7 @@ description: You can explore the changeId method of DataCollection in the docume | |||
@params: | |||
- `id: string | number` - the old id of an item | |||
- `newId: string | number` - optional, the new id; auto-generated if not set | |||
- `silent: boolean` - true, to prevent changing the id; otherwise, false | |||
- `silent: boolean` - optional, *true*, to prevent changing the id; otherwise, *false* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 кажется тут не то описание. silent
- если использовать метод с включенным данным флагом, метод будет работать в "тихом" режиме, то есть - без вызова событий. Метод сработает, события будут проигнорированы.
- `permanent: boolean` - optional, *true* to make the current filter permanent. It will be applied even if the next filtering doesn't have the `add:true` property in its configuration object. Such a filter can be removed just with the [resetFilter()](data_collection/api/datacollection_resetfilter_method.md) method | ||
- `silent: boolean` - optional, if *true*, the update of the DataCollection state won't trigger the component repainting, *false* by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 откуда тут перерисовка?)) Это частный случай, а может и сработает. Можно в примечаниях написать, что:
после использования данного метода с включенным флагом
silent
вам потребуется принудительная перерисовка компонента при помощи методаpaint()
Флаг silent
вызывает метод без вызова событий.
@@ -30,7 +30,7 @@ const item = component.data.find(function(item){ | |||
}); | |||
|
|||
//searching for an item by the attribute key | |||
const item = component.data.find({by:"text",match:"Manager"}); | |||
const item = component.data.find({ by:"text",match:"Manager" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 понимаю, что правка локальная. Если есть возможность, поправ пожалуйста отступы в примерах:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 почти во всех примерах есть такая проблема
@@ -14,7 +14,7 @@ description: You can explore the getLength method of DataCollection in the docum | |||
The number of elements of a data collection. | |||
|
|||
@example: | |||
component.data.getLength(); | |||
const items = component.data.getLength(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 метод возвращает длину коллекции. Название переменной можно было назвать dataLength
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 по описанию подавлю. В TreeCollection
этот метод коварен, и вместо длинны всех данных отобразит длину уровня. Вроде есть об этом запись в TreeCollection
. Но я подумал, что в гайдах стоит упомянуть, если не будешь делать отдельный гайд по TreeCollection
@@ -8,20 +8,21 @@ description: You can explore the reduce method of DataCollection in the document | |||
|
|||
@short: reduces the array to a single value | |||
|
|||
@signature: {'reduce(callback: (acc: any, item: any) => any, acc: any): any;'} | |||
@signature: {'reduce(callback: (acc: any, item: any, index?: number) => any, acc: any): any;'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 index
не опционален.
|
||
**Related sample**: [Data. Parse](https://snippet.dhtmlx.com/0zrxtmvi) | ||
|
||
## Checking whether data is loaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 Хорошо, мы проверяем загруженные данным. А как мы их загрузили? Нет описания ленивой загрузки.
grid.data.save("http://userurl/"); | ||
|
||
//or | ||
grid.data.save(new DataProxy({ url:"http://userurl/" })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 это ведь тоже к загрузке относится, в гайде инфы нет DataProxy
|
||
~~~jsx | ||
// creating a new grid | ||
const grid2 = new dhx.Grid(document.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 будет просто ошибка. Grid без свойства columns не инициализируется
@@ -0,0 +1,321 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 все примеры необходимо привести в порядок
@@ -0,0 +1,182 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafanya23 описание с методов тут не годится. Это просто дублирование информации. Про фильтрацию есть, что рассказать и показать. Особенно про smartSorting
, которая по факту мультисортировка. Есть даже примеры в snippet tool
No description provided.