Interface ILayout

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. Represents a layout for the ListView.

Index

Properties

Methods

Properties

public horizontal: boolean

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Methods

public calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): Promise

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • beginScrollPosition: number

    The first visible pixel in the ListView. For horizontal layouts, this is the x-coordinate of the pixel. For vertical layouts, this is the y-coordinate.

  • wholeItem: boolean

    true if the item must be completely visible; otherwise, false if its ok for the item to be partially visible. Promise.

Returns

Promise

A Promise for the index of the first visible item at the specified point.

public calculateLastVisible(endScrollPosition: number, wholeItem: boolean): Promise

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • endScrollPosition: number

    The last visible pixel in the ListView. For horizontal layouts, this is the x-coordinate of the pixel. For vertical layouts, this is the y-coordinate.

  • wholeItem: boolean

    true if the item must be completely visible; otherwise, false if its ok for the item to be partially visible. Promise.

Returns

Promise

A Promise for the index of the last visible item at the specified point.

public endLayout(): any

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Returns

any

A object that has these properties: animationPromise, newEndIndex.

public getItemPosition(itemIndex: number): Promise

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • itemIndex: number

    The index of the item.

Returns

Promise

A Promise that returns an object with these properties: left, top, contentWidth, contentHeight, totalWidth, totalHeight.

public getKeyboardNavigatedItem(itemIndex: number, element: HTMLElement, keyPressed: Key): Promise

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • itemIndex: number

    The data source index of the current item.

  • element: HTMLElement

    The element for the current item.

  • keyPressed: Key

    The key that was pressed. This function must check for the arrow keys (leftArrow, upArrow, rightArrow, downArrow), pageDown, and pageUp and determine which item the user navigated to.

Returns

Promise

A Promise that contains the index of the next item (This item becomes the current item).

public getScrollBarRange(): Promise

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Returns

Promise

A Promise that returns an object that has these properties: beginScrollPosition, endScrollPosition.

public hitTest(x: number, y: number)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • x: number

    The x-coordinate to test.

  • y: number

    The y-coordinate to test.

public itemsAdded(elements: Array<HTMLElement>)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • elements: Array<HTMLElement>

    The elements that represent the items that were added.

public itemsMoved()

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

public itemsRemoved(elements: Array<HTMLElement>)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • elements: Array<HTMLElement>

    The elements that represent the items that were removed.

public layoutHeader(groupIndex: number, element: HTMLElement)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • groupIndex: number

    The index of the group in the group data source.

  • element: HTMLElement

    The element to render for the group header.

public layoutItem(itemIndex: number, element: HTMLElement)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • itemIndex: number

    The index of the item in the data source.

  • element: HTMLElement

    The element to render for the item.

public prepareHeader(element: HTMLElement)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • element: HTMLElement

    The element that represents a header in the data source.

public prepareItem(element: HTMLElement)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • element: HTMLElement

    An element that represents an item in the data source.

public releaseItem(element: HTMLElement)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • element: HTMLElement

    The element being released.

public reset()

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

public setSite(site: ILayoutSite)

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • site: ILayoutSite

    The layout site for the layout. You can use this object to query the hosting ListView for info you might need to lay out items.

public startLayout(beginScrollPosition: number, endScrollPosition: number, count: number): Promise

This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface.

Parameters

  • beginScrollPosition: number

    The starting pixel of the area to which the items are rendered.

  • endScrollPosition: number

    The last pixel of the area to which the items are rendered.

  • count: number

    The upper bound of the number of items to render.

Returns

Promise

A Promise that returns an object that has these properties: beginIndex, endIndex.