`g1.datafilter(data, filters)` returns the filtered data based on the filters. While urlfilter on [$.formhandler](#formhandler) applies filtering on data server side, `datafilter` applies urlfilter on frontend loaded data.
## g1.datafilter
`g1.datafilter(data, filters)` returns the filtered data based on the filters. While urlfilter on [$.formhandler](#formhandler) applies filtering on data server side, `datafilter` applies urlfilter on frontend loaded data.
...
...
@@ -504,6 +498,7 @@ In the above example, `data-page-size="10"` over-rides `pageSize: 20`.
The full list of options is below. Simple options can be specified as `data-` attributes as well.
-`src`: [FormHandler][formhandler] URL endpoint
-`data`: Array of objects. Dataset for formhandler table. If both `src` and `data` are provided, `data` takes priority.
-`namespace`: (Optional) If the URL has `?name:key=value`, the filter
`key=value` only applies to formhandlers with namespace as `name`.
Filters without a namespace like `?key=value` will apply to all formhandlers.
...
...
@@ -610,6 +605,8 @@ Features to be implemented:
-`args`: the URL query parameters passed to the request
-`options`: applied options to the FormHandler
Note: Make sure `load` event listener is attached before calling `$.formhandler()`
### $.formhandler examples
Render a table using the FormHandler at `./data`:
...
...
@@ -1239,7 +1236,7 @@ Drilldown feature example:
-`drilldown`:
-`rootLayer`: `geojson/topojson` layer that acts as root layer to drilldown further.
-`levels`: Array of objects that provides layer info
-`layerName`: Can be a string or function. Function takes argument as `properties` of parentLayer feature
-`layerName`: Can be a string or function. Function takes argument as `properties` of parentLayer feature
-`layerOptions`: Same as layer options in `layers` option. If `url` is function, `url` takes argument as `properties` of parentLayer feature
-`zoomHandler`: <!-- TODO -->
-`zoomlevel`: must be a `geojson` layer name or function. If given a `geojson` layer name, shows this layer and hides all other `geojson` layers. Optimize this to load only layer that is visible in viewport.