Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update link to go to OpenMRS Add-ons index instead

...

Resources

...

schema: By default the schema from the Model of the list's Collection is used to determine how to display the attributes of the list items, or the editor to use to edit them, in the case that the inlineEdit action is enabled.  In order to avoid having to modify the Model's schema to suit the list display, it is possible to override part or all of the Model schema using this option.

Events

itemSelect: When an item in the list is selected, the View will fire an "itemSelect" event with the view of the selected item as a parameter.

FetchHelpers

GenericListView has a property called fetchable which is an optional list of views or objects that implement the FetchHelper "interface"—that is they implement a getFetchOptions function that returns a modified options map to be used by the list view when fetching the list of objects.  Examples of FetchHelpers include the PaginateView which takes care of fetching only the items on the current page, and search views such as DepartmentAndNameSearchView which filters items based on their name and department.

FetchHelpers usually fire a "fetch" event which is handled by the list view that they affect to refresh the current items.

GenericListItemView

GenericListItemView is the default View used by GenericListView to render an individual item in the list.

Events

blur: When the item loses focus (especially when using inlineEdit), the view will fire a "blur" event with itself as a parameter.

change: If the underlying model of the list item changes, the view will fire a "change" event with itself as a parameter.

focus: When the item receives focus (especially when using inlineEdit), the view will fire a "focus" event with itself as a parameter.

remove: When an item is removed from the list, the view will fire a "remove" event with the removed model as a parameter.

select: When the item is selected, the view fires a "select" event with itself as a parameter.

GenericListEntryView

GenericListEntryView is an extension to GenericListView that supports interactive, inline adding/editing of list items.  See the Cashier Module's bill screen for an example.