StatusQuery

Type: XPathQuery

Sets a status for the node.

An XPath query that determines which status component should be shown for a node by referencing the 'id' of the registered status. This status component is primarily visualized in the outline view.

See registerNodeStatus for a detailed example on how to use these APIs together.

Note: when writing any XPath query, take the performance of your query into consideration. There are (usually) multiple ways of expressing the same thing, but with significant differences in (runtime query execution) performance.

For example:

JavaScript

configureProperties(sxModule, 'self::topic[title="review"]', { statusQuery: '"review"' })

versus

JavaScript

configureProperties(sxModule, 'self::topic', { statusQuery: 'if (title eq "review") then "review" else () })

Using separate selectors like the former for each status leads to a large number of selectors that need to be evaluated for each item in the outline in order to determine the status query. It is more efficient to use fewer selectors and a more explicit query such as the latter example. This is especially true when buckets can’t be used to optimize query evaluation. For more details about these performance concerns, check out this blog post written by our XPath (engine) developer, paying special attention to the "Buckets" section: https://www.fontoxml.com/blog/make-your-editor-fast-optimize-your-xpaths/.

This query can also return multiple strings. For example:

JavaScript

configureProperties(sxModule, 'self::topic', {
    statusQuery: '(if (title eq "review") then "review" else (), "status-that-is-always-there")'
})

Applies to: