sortlinkForName = (fname, req, viewname, statehash) => {
  const _sortby = req.query ? req.query[`_${statehash}_sortby`] : undefined;
  const _sortdesc = req.query ? req.query[`_${statehash}_sortdesc`] : undefined;
  const desc =
    typeof _sortdesc == "undefined"
      ? _sortby === fname
      : _sortdesc
        ? "false"
        : "true";
  return `sortby('${text(fname)}', ${desc}, '${statehash}', this)`;
}
@param {string} fname
@param {object} req
@returns {string}