List WebPart

This webpart component removes the overhead of defining the target list, and allows the developer to specify the code related to rendering the list data.

Constructor The constructor allows the developer to specify a static configuration. An optional configuration webpart exists to allow the user to specify the configuration when editing the page.

Configuration

  • ListName:string
    • The list name
  • WebUrl:string
    • The relative url to the web containing the list.

Query Options

Specify the following values in the constructor:

  • _caml:string
    • The CAML query to execute against the target list.
  • _query:ODataQuery
    • The OData query to execute against the target list.

Events

  • onRenderContainer
    • An optional event to control how the webpart is rendered. The input property of this event are the list items.
  • onRenderItem
    • The required event to return the item component. The input property of this event is the list item.

Configuration WebPart (Optional)

The list configuration webpart displays a custom panel to allow the user to select the following:

  • List
    • Drop down list of available lists in the target web
  • Web Url
    • Relative url to the web containing the list
    • A blank value defaults to the current web

Additional Information Reference this github project for an example of using the List webpart.