ObjectListViewComponent Class
addon/components/object-list-view.js:29
Object list view component.
Item Index
Methods
- _actualDeleteAllRecords
- _actualDeleteRecord
- _addFilterForColumn
- _addModel
- _addRow
- _afterColumnResize
- _contentDidChange
- _contentDidChangeProxy
- _createColumn
- _deleteHasManyRelationships
- _deleteHasManyRelationships
- _deleteRecord
- _deleteRows
- _deleteRows
- _filterByAnyMatch
- _filterConditionChanged
- _generateColumns
- _getAttribute
- _getAttributesName
- _getColumnPropertyName
- _getComponentForDdlFilter
- _getFilterComponent
- _getFilterComponentByCondition
- _getModelKey
- _getRowByKey
- _initDdlFilterSettings
- _moveRow
- _openModalDialog
- _refreshList
- _reinitResizablePlugin
- _removeModelWithKey
- _restoreSelectedRecords
- _searchForContentChange
- _selectAll
- _setActiveRecord
- _setBackground
- _setBackground
- _setColumnWidths
- _setContent
- _setCurrentColumnsWidth
- _setParent
- _showFiltersObserver
- actions.addErrorMessage
- actions.applyFiltersByEnter
- actions.checkAll
- actions.checkAllAtPage
- actions.clearFilterForColumn
- actions.clearSorting
- actions.customButtonInRowAction
- actions.deleteRow
- actions.dismissErrorMessages
- actions.error
- actions.filterConditionChanged
- actions.groupEditRowClick
- actions.headerCellClick
- actions.onCheckRowMenuItemClick
- actions.rowClick
- actions.selectRow
- configurateRow
- configurateSelectedRows
- didUpdateAttrs
- getTargetObjectByCondition.
- initProperty
- openCreateModalDialog
- openEditModalDialog
- rejectError
- setColumnWidths
Properties
- _colResizableInit
- _colResizableInit
- _modalControllerName
- _modalTemplateName
- _modelProjection
- action
- addColumnToSorting
- allowColumnResize
- allSelect
- allSelectAtPage
- appConfig
- appConfigSettings
- appConfigSettingsPath
- appState
- cellComponent
- checkRowsSettingsItems
- colspan
- columns
- componentName
- content
- contentWithKeys
- currentController
- customColumnAttributes
- customParameters
- customTableClass
- ddlFilterSettings
- defaultLeftPadding
- defaultRowConfig
- dynamicProperties
- editOnSeparateRoute
- filterByAnyMatch
- fixedHeader
- hasContent
- hasEditableValues
- immediateDelete
- mainModelProjection
- menuInRowAdditionalItems
- menuInRowHasAdditionalItems
- modelProjection
- notUseUserSettings
- objectlistviewEvents
- objectlistviewEventsService
- onEditForm
- orderable
- orderedProperty
- placeholder
- readonly
- readonlyAttr
- relatedModel
- required
- rowByRowLoadingProgress
- rowClickable
- saveBeforeRouteLeave
- searchForContentChange
- selectedRecord
- selectedRecords
- showAsteriskInRow
- showCheckBoxInRow
- showDeleteButtonInRow
- showDeleteMenuItemInRow
- showEditButtonInRow
- showEditMenuItemInRow
- showFiltersInModal
- showHelperColumn
- showMenuColumn
- showPrototypeButtonInRow
- showPrototypeMenuItemInRow
- showValidationMessages
- sortByColumn
- sorting
- sortTitleCompute
- store
- tableClass
- tableStriped
- useRowByRowLoading
- useRowByRowLoadingProgress
Methods
_actualDeleteAllRecords
-
componentName
-
modelName
-
filterQuery
Actually delete the all records on all pages.
_actualDeleteRecord
-
record
-
immediately
Actually delete the record.
_addFilterForColumn
-
column
-
attr
-
bindingPath
Add filter parameters for column.
_addModel
-
record
Adds detail model to current model, generates unique key for detail model.
If record is deleted then undefined
is returned and record isn't added to list.
Parameters:
-
record
DS.ModelDetail model to add to current model
Returns:
Unique key for added record or undefined
if record is deleted
_addRow
-
componentName
Adds row to component and calls click on row action if detail is edited on separate route. This method is triggered on toolbar's add batton click.
Parameters:
-
componentName
StringThe name of triggered component
_afterColumnResize
-
eventParams
It handles the end of column resize. New column widths are send to user settings service for saving.
Parameters:
-
eventParams
ObjectParameters of the end of column resizing
_contentDidChange
()
private
It observes changes of model's data that are displayed on component if flag searchForContentChange is enabled.
Property changing displayes automatically. Component compares current detail array with used on component, removes deleted and marked as deleted on model level records, adds created on model level records.
_contentDidChangeProxy
()
private
Schedules the _contentDidChange
function to run once in the render
queue.
_createColumn
()
private
Create the column.
_deleteHasManyRelationships
-
record
-
immediately
Delete all hasMany relationships in the record
.
Parameters:
Returns:
A promise that will be resolved when relationships have been deleted
_deleteHasManyRelationships
-
record
-
immediately
-
promises
Find all hasMany relationships in the record
and place promises in right order.
_deleteRecord
-
record
-
immediately
Delete the record.
_deleteRows
-
componentName
-
filterQuery
Handler for "delete all rows on all pages" event in objectlistview.
_deleteRows
-
componentName
-
immediately
Handler for "delete selected rows" event in objectlistview.
_filterByAnyMatch
-
pattern
The handler for "filter by any match" event triggered in objectlistview events service.
Parameters:
-
pattern
StringThe pattern to filter objects
_filterConditionChanged
-
componentName
-
filter
-
newValue
-
oldvalue
Calls the filterConditionChanged
action when filters are displayed in the modal window.
_generateColumns
()
private
Generate the columns.
_getAttribute
-
attr
-
bindingPath
Return attribute of model.
Returns:
Return attribute of model.
_getAttributesName
()
private
Get attributes name from model.
_getColumnPropertyName
-
currentItem
This method returns property name for column.
Property name is got from atribute data-olv-header-property-name
of column header.
If property name won't be found, exeption will be thrown.
Parameters:
-
currentItem
ObjectCurrent column header to get property name from
Returns:
Corresponding property name for column
_getComponentForDdlFilter
-
bindingPath
Return object with parameters for component.
Parameters:
-
bindingPath
String
Returns:
Object with parameters for component.
_getFilterComponent
-
type
Return object with parameters for component.
Parameters:
-
type
String
Returns:
Object with parameters for component.
_getFilterComponentByCondition
-
newCondtition
-
oldCondition
-
attributeType
Alter filter component depending on condition chosen by user.
Returns:
Object with parameters for component.
_getModelKey
()
private
Get the key of model.
_getRowByKey
()
private
Get the row by key.
_moveRow
()
private
Move all selected records.
_openModalDialog
-
modelObject
-
editFormRoute
-
isNewRecord
-
useSidePageMode
_refreshList
-
componentName
Refresh list with the entered filter.
Parameters:
-
componentName
String
_reinitResizablePlugin
()
private
It reinits plugin for column resize. Reinit is important for proper position of resize elements.
_removeModelWithKey
()
private
Remove the model with key.
_restoreSelectedRecords
()
private
Restore selected records after refreshing or transition to other page.
_searchForContentChange
()
private
It observes changes of flag searchForContentChange.
If flag searchForContentChange changes its value observer on component content is set otherwise it is removed.
_selectAll
()
private
Select/Unselect all records on all pages.
_setBackground
()
private
Set fixed cells backgrounds.
_setBackground
()
private
Fixed table head.
_setColumnWidths
-
userSetting
It handles the end of getting user setting with column widths.
Parameters:
-
userSetting
ArrayUser setting to apply to control
_setContent
-
componentName
-
sorting
Sets content for component.
_setCurrentColumnsWidth
()
private
Set current columns width for currentController.
_setParent
()
private
Set style of table parent.
_showFiltersObserver
()
private
It observes changes of flag FlexberryObjectlistviewComponent/showFilters:property.
If flag FlexberryObjectlistviewComponent/showFilters:property changes its value and flag is true trigger scroll.
actions.applyFiltersByEnter
()
Applies filters if the Enter
key has been pressed.
actions.checkAll
-
e
This action is called when click check all at all button.
Parameters:
-
e
jQuery.EventjQuery.Event by click on ckeck all button
actions.checkAllAtPage
-
e
This action is called when click check all at page button.
Parameters:
-
e
jQuery.EventjQuery.Event by click on check all at page button
actions.clearFilterForColumn
-
filter
Cleans the filter for one column.
Parameters:
-
filter
ObjectObject with the filter description.
actions.clearSorting
-
e
This action is called when click clear sorting button.
Parameters:
-
e
jQuery.EventjQuery.Event by click on clear sorting button
actions.customButtonInRowAction
-
actionName
-
model
Just redirects action up to flexberry-objectlistview
component.
actions.deleteRow
-
recordWithKey
-
e
This action is called when user click on menu in row.
Parameters:
-
recordWithKey
DS.ModelA record with key
-
e
jQuery.EventjQuery.Event by click on row
actions.dismissErrorMessages
()
public
actions.filterConditionChanged
-
filter
-
newCondition
-
oldCondition
Called when filter condition in any column was changed by user.
actions.groupEditRowClick
-
record
-
[options]
modelNoRollBack
to true
at current controller, redirects to detail's route, save necessary data to service.
Parameters:
-
record
Ember.ObjectRecord related to clicked table row. -
[options]
Object optionalRecord related to clicked table row.-
saveBeforeRouteLeave
BooleanFlag: indicates whether to save current model before going to the detail's route.
-
editOnSeparateRoute
BooleanFlag: indicates whether to edit detail on separate route.
-
modelName
StringClicked detail model name (used to create record if record is undefined).
-
detailArray
ArrayCurrent detail array (used to add record to if record is undefined).
-
editFormRoute
BooleanPath to detail's form.
-
actions.headerCellClick
-
column
-
e
This action is called when user click on header.
Parameters:
-
column
Object -
e
jQuery.EventjQuery.Event by click on column.
actions.onCheckRowMenuItemClick
-
e
Handler click on flexberry-menu.
Parameters:
-
e
jQuery.EventjQuery.Event by click on menu item
actions.rowClick
-
recordWithKey
-
params
This action is called when user click on row.
actions.selectRow
-
recordWithKey
-
e
This action is called when user select the row.
Parameters:
-
recordWithKey
DS.ModelA record with key
-
e
jQuery.EventjQuery.Event by click on row
configurateRow
-
rowConfig
-
record
Hook for configurate rows.
Parameters:
Example:
<!-- app/templates/employees.hbs -->
{{flexberry-objectlistview
...
configurateRow=(action "configurateRow")
...
}}
// app/controllers/employees.js
import ListFormController from './list-form';
export default ListFormController.extend({
actions: {
configurateRow(rowConfig, record) {
set(rowConfig, 'canBeDeleted', false);
if (record.get('isMyFavoriteRecord')) {
set(rowConfig, 'customClass', 'my-fav-record');
}
let readonlyColumns = [];
if (record.get('isNameColumnReadonly')) {
readonlyColumns.push('name');
}
set(rowConfig, 'readonlyColumns', readonlyColumns);
}
}
});
configurateSelectedRows
-
selectedRecords
Hook for configurate selected rows.
Parameters:
-
selectedRecords
DS.Model[]All selected records.
Example:
<!-- app/templates/employees.hbs -->
{{flexberry-objectlistview
...
configurateSelectedRows=(action "configurateSelectedRows")
...
}}
// app/controllers/employees.js
import ListFormController from './list-form';
export default ListFormController.extend({
actions: {
configurateSelectedRows(selectedRecords) {
// do something
}
}
});
getTargetObjectByCondition.
-
condition
Returns that 'targetObject' (from 'targetObject's hierarchy) which satisfies a given condition.
let controller = this.getTargetObjectByCondition((targetObject) => {
return targetObject instanceof Controller;
});
Parameters:
-
condition
FunctionCallback-function, which will be called for each 'targetObject' in 'targetObject's hierarchy, until callback return true for one of them.
Returns:
Target object which satisfies a given condition or null.
initProperty
-
options
Initializes component's property with recpect to following priority: 1 - template-defined parameters, 2 - applicaion configuration-defined parameters (JSON from ./config/environment by path defined in 'appConfigSettingsPath' property), 3 - component-defined defaults. Note! It is important to be declared as undefined for those component properties, which will be initialized through 'initProperty' call.
// ./config/environment.js.
module.exports = function(environment) {
var ENV = {
APP: {
components: {
myComponent: {
myComponentProperty: 'myComponentProperty config-defined default value',
}
}
}
};
return ENV;
};
// /components/my-component.js
import FlexberryBaseComponent from 'ember-flexberry/flexberry-base-component';
export default FlexberryBaseComponent.extend({
appConfigSettingsPath: 'APP.components.myComponent',
myComponentProperty: undefined,
init() {
this._super.apply(this, arguments);
this.initProperty({ propertyName: 'myComponentProperty', defaultValue: 'myComponentProperty default value' });
}
});
openCreateModalDialog
-
modelController
-
editFormRoute
-
useSidePageMode
openEditModalDialog
-
record
-
editFormRoute
-
useSidePageMode
setColumnWidths
-
componentName
Handler for updateWidth action.
Parameters:
-
componentName
StringThe name of object-list-view component.
Properties
_colResizableInit
Boolean
private
Flag indicates whether columns resizable plugin already was initialized.
Default: false
allowColumnResize
Boolean
Flag indicates whether allow to resize columns (if true
) or not (if false
).
Default: true
appConfigSettings
Object
Component settings object from application configuration (part of JSON from ./config/environment.js). Part of appConfig related to appConfigSettingsPath.
Default: null
appConfigSettingsPath
String
Path to component's settings in application configuration (JSON from ./config/environment.js).
Default: 'APP.components.objectListView'
cellComponent
Object
Default cell component that will be used to display values in columns cells.
Sub-properties:
checkRowsSettingsItems
Unknown
contentWithKeys
Object[]
Array of models from content collection with some synthetic keys related to them.
Default: null
currentController
Controller
Current controller.
Default: null
customColumnAttributes
Object
Custom attributes which will be added to each generated column.
Default: null
customTableClass
String
Custom classes for table.
Default: ''
Example:
<!-- app/templates/employees.hbs -->
{{flexberry-objectlistview
...
customTableClass="inverted blue"
...
}}
ddlFilterSettings
Array
Settings for filters with a dropdown list of values.
Example:
ddlFilterSettings: computed(function () { return [{ modelName: 'ember-flexberry-dummy-suggestion-type', projectionName: 'SuggestionTypeL', propName: 'name', bindingPath: 'type' }] })
dynamicProperties
Object
Component dynamic properties ({ componentPropertyName: value }). Used when component renders dynamically with ember {{component}} helper: {{component 'my-component' value=value dynamicProperties=myConponentProperties}}. In the end of component initialization its properties values will be replaced with values from this object.
Default: null
editOnSeparateRoute
Object
Flag indicates whether records should be edited on separate route.
Default: false
fixedHeader
Boolean
Flag indicates whether to fix the table head (if true
) or not (if false
).
Default: true
hasEditableValues
Boolean
Flag indicates whether some column contains editable component instead of default cellComponent.
Don't work if change componentName
inside cellComponent
.
immediateDelete
Boolean
Flag indicates whether DELETE request should be immediately sended to server (on each deleted record) or not.
Default: false
mainModelProjection
Object
Main model projection. Accepts object projections. Needs for support locales of captions.
modelProjection
Object | String
Model projection which should be used to display given content. Accepts object or name projections.
Default: null
notUseUserSettings
Boolean
Flag indicates whether to not use userSetting from backend
Default: false
objectlistviewEvents
Service
objectlistviewEventsService
Service
Service that triggers objectlistview events.
placeholder
String
Text to be displayed in table body, if content is not defined or empty.
Default: 't('components.object-list-view.placeholder')'
readonlyAttr
String | Undefined
Readonly HTML attribute following to the readonly
query param. According to the W3C standard, returns 'readonly' if readonly
is true
and undefined
otherwise.
rowByRowLoadingProgress
Boolean
Flag indicates whether to show row by row loading in progress.
Default: false
saveBeforeRouteLeave
Boolean
Flag indicates whether to save current model before going to the detail's route.
Default: false
searchForContentChange
Boolean
Flag indicates whether to look for changes of model (and displaying corresponding changes on control) or not.
If flag is enabled component compares current detail array with used on component, removes deleted and marked as deleted on model level records, adds created on model level records.
Default: false
showAsteriskInRow
Boolean
Flag indicates whether to show asterisk icon in first column of every changed row.
Default: false
showCheckBoxInRow
Boolean
Flag indicates whether to show checkbox in first column of every row.
Default: false
showDeleteButtonInRow
Boolean
Flag indicates whether to show delete button in first column of every row.
Default: false
showDeleteMenuItemInRow
Boolean
Flag indicates whether to show dropdown menu with delete menu item, in last column of every row.
Default: false
showEditButtonInRow
Boolean
Flag indicates whether to show edit button in first column of every row.
Default: false
showEditMenuItemInRow
Boolean
Flag indicates whether to show dropdown menu with edit menu item, in last column of every row.
Default: false
showPrototypeButtonInRow
Boolean
Flag indicates whether to show prototype button in first column of every row.
Default: false
showPrototypeMenuItemInRow
Boolean
Flag indicates whether to show dropdown menu with prototype menu item, in last column of every row.
Default: false
showValidationMessages
Boolean
Flag: indicates whether to show validation messages in every row or not.
Default: false
store
Service
Ember data store.
useRowByRowLoadingProgress
Boolean
Flag indicates whether to use bottom row by row loading progress while rows in loading state.
Default: false