Class: Sortby

Sortby

通过指定字段进行排序的方法类。

new Sortby(options)

Usage
import { Sortby } from '@supermapgis/iclient-leaflet';

new Sortby(options);
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
  new L.supermap.Sortby({paramsNames});
  // 弃用的写法
  new SuperMap.Sortby(options);
</script>
common/iServer/Sortby.js, line 6
Name Type Description
options Object

参数。

Name Type Description
field string

属性名称。

direction Sortby.Direction

排序规则,默认升序。

API Relations

As method parameter: Sortby.constructFromObject.
Returned by: Sortby.constructFromObject.

Members

(static, readonly) Directionstring

排序的类型枚举。

Properties:
Name Type Default Description
ASC string ASC

升序。

DESC string DESC

降序。

directionSortby.Direction

排序规则。

Default Value:
Sortby.Direction.ASC

fieldstring

属性名称。

Methods

constructFromObject(data, obj){Sortby}

common/iServer/Sortby.js, line 44

目标对象新增该类的可选参数。

Name Type Description
data Object

要转换的数据。

obj Sortby

返回的模型。

Returns:
Type Description
Sortby 返回结果。

destroy()

common/iServer/Sortby.js, line 34

释放资源,将引用资源的属性置空。