Readonly Mode, JavaScript Programming Example of Readonly Mode

Readonly Mode, JavaScript Programming Example of Readonly Mode

If you want to disable changing of the Pivot configuration settings, you can use the programming example below to establish a readonly mode in Pivot. Besides, you can set a readonly title that will be shown instead of the link which opens a popup with Pivot configuration settings. Don't hesitate to use the free coding samples by Webix to create custom business web apps.

JS Code

webix.ready(function() { 
    webix.CustomScroll.init();

  webix.ui({
    type: "space",
    rows: [
      {
        view: "switch",
        label: "Readonly",
        value: 1,
        click: function() {
          $$("pivot").getState().readonly = !!this.getValue();
        },
      },
      {
        view: "pivot",
        id: "pivot",
        structure: {
          rows: ["form", "name"],
          columns: ["year"],
          values: [{ name: "oil", operation: ["min", "sum"] }],
        },
        readonly: true,
        url: "https://cdn.webix.com/demodata/pivot.json",
      },
    ],
  });
});