mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-27 09:48:21 +01:00
ListView: add API to scroll the list to top/bottom
This commit is contained in:
parent
d3540d7575
commit
5f92e41021
26
d.ts/antos.d.ts
vendored
26
d.ts/antos.d.ts
vendored
@ -4744,6 +4744,18 @@ declare namespace OS {
|
|||||||
* @memberof ListViewTag
|
* @memberof ListViewTag
|
||||||
*/
|
*/
|
||||||
protected dropoff(e: any): void;
|
protected dropoff(e: any): void;
|
||||||
|
/**
|
||||||
|
* Scroll the list view to bottom
|
||||||
|
*
|
||||||
|
* @memberof ListViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_bottom(): void;
|
||||||
|
/**
|
||||||
|
* Scroll the list view to top
|
||||||
|
*
|
||||||
|
* @memberof ListViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_top(): void;
|
||||||
/**
|
/**
|
||||||
* calibrate the list layout
|
* calibrate the list layout
|
||||||
*
|
*
|
||||||
@ -6316,13 +6328,25 @@ declare namespace OS {
|
|||||||
* @memberof GridViewTag
|
* @memberof GridViewTag
|
||||||
*/
|
*/
|
||||||
delete(row: GridRowTag): void;
|
delete(row: GridRowTag): void;
|
||||||
|
/**
|
||||||
|
* Scroll the grid view to bottom
|
||||||
|
*
|
||||||
|
* @memberof GridViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_bottom(): void;
|
||||||
|
/**
|
||||||
|
* Scroll the grid view to top
|
||||||
|
*
|
||||||
|
* @memberof GridViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_top(): void;
|
||||||
/**
|
/**
|
||||||
* Push a row to the grid
|
* Push a row to the grid
|
||||||
*
|
*
|
||||||
* @param {GenericObject<any>[]} row list of cell data
|
* @param {GenericObject<any>[]} row list of cell data
|
||||||
* @param {boolean} flag indicates where the row is add to beginning or end
|
* @param {boolean} flag indicates where the row is add to beginning or end
|
||||||
* of the row
|
* of the row
|
||||||
* @memberof GridViewTags
|
* @memberof GridViewTag
|
||||||
*/
|
*/
|
||||||
push(row: GenericObject<any>[], flag: boolean): void;
|
push(row: GenericObject<any>[], flag: boolean): void;
|
||||||
/**
|
/**
|
||||||
|
@ -869,6 +869,25 @@ namespace OS {
|
|||||||
}
|
}
|
||||||
$(row).remove();
|
$(row).remove();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Scroll the grid view to bottom
|
||||||
|
*
|
||||||
|
* @memberof GridViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_bottom()
|
||||||
|
{
|
||||||
|
this.refs.container.scrollTo({ top: this.refs.container.scrollHeight, behavior: 'smooth' })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll the grid view to top
|
||||||
|
*
|
||||||
|
* @memberof GridViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_top()
|
||||||
|
{
|
||||||
|
this.refs.container.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Push a row to the grid
|
* Push a row to the grid
|
||||||
@ -876,7 +895,7 @@ namespace OS {
|
|||||||
* @param {GenericObject<any>[]} row list of cell data
|
* @param {GenericObject<any>[]} row list of cell data
|
||||||
* @param {boolean} flag indicates where the row is add to beginning or end
|
* @param {boolean} flag indicates where the row is add to beginning or end
|
||||||
* of the row
|
* of the row
|
||||||
* @memberof GridViewTags
|
* @memberof GridViewTag
|
||||||
*/
|
*/
|
||||||
push(row: GenericObject<any>[], flag: boolean): void {
|
push(row: GenericObject<any>[], flag: boolean): void {
|
||||||
const rowel = $("<afx-grid-row>").css(
|
const rowel = $("<afx-grid-row>").css(
|
||||||
|
@ -1346,6 +1346,26 @@ namespace OS {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll the list view to bottom
|
||||||
|
*
|
||||||
|
* @memberof ListViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_bottom()
|
||||||
|
{
|
||||||
|
this.refs.mlist.scrollTo({ top: this.refs.mlist.scrollHeight, behavior: 'smooth' })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll the list view to top
|
||||||
|
*
|
||||||
|
* @memberof ListViewTag
|
||||||
|
*/
|
||||||
|
scroll_to_top()
|
||||||
|
{
|
||||||
|
this.refs.mlist.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calibrate the list layout
|
* calibrate the list layout
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user