Skip to content

CUSTOM custom views: expand and align the controller API (filters, orders, totals, reports/export, expand, view mode) #1675

@AlexKirkouski

Description

@AlexKirkouski

Part of #1666 (CUSTOM custom views — phase 4).

Description

The custom-view controller exposes change/exec, and the classic controller has some helpers (e.g. specific view-filter helpers) that React lacks. Round out the controller surface and make React and classic expose the same set:

  • apply filters and orders programmatically;
  • get record count and column sums;
  • run a report, and export the grid;
  • expand / collapse tree nodes;
  • switch list view mode; copy / paste;
  • ensure exec / eval / change and the view-filter helpers are reachable the same way in both React and classic.
DESIGN sales { salesBox { custom = 'SalesGrid'; } };
// API names illustrative — exact shape decided in implementation
function SalesGrid({ data, controller }) {
  return <>
    <button onClick={() => controller.setFilter(/* … */)}>Filter</button>
    <button onClick={() => controller.runReport()}>Report</button>
    <button onClick={() => controller.exportGrid('xlsx')}>Export</button>
    <div>Total: {/* controller.calculateSum(...) */}</div>
  </>;
}

Reason

React custom views can't filter, sort, total, report or export through the form today, and the React and classic controllers diverge, so a component is not portable between them. Exposing these interactive-safe operations consistently makes custom views first-class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions