mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-11-16 09:48:20 +01:00
ListView: add API to scroll the list to top/bottom
All checks were successful
gitea-sync/antos/pipeline/head This commit looks good
All checks were successful
gitea-sync/antos/pipeline/head This commit looks good
This commit is contained in:
parent
c8fbc08c63
commit
d1f2861fd5
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