getMode ();
The getMode method determines whether the dashboard is opened in edit or view mode.
It returns view if the dashboard is opened in view mode, or edit if the dashboard is opened in edit mode.
If an instance of the Kap.Dashboard class is created with the Kap.KapBox method, the method returns edit. If the instance of the Kap.Dashboard class is created with the Dashboard constructor, the method returns view.
To execute the example, the page must contain a dashboard constructor named kapBox. The BODY tag must contain a DIV element with the "but" identifier. Add a button clicking which get the current mode of working with dashboard:
var modeButton = new PP.Ui.Button({ ParentNode: "but", Content: "Work mode", Click: function () { if (kapBox.getMode() == "edit") { alert("Edit"); } else alert("View"); } });
After executing the example the Working Mode button is placed in the page. Clicking this button shows a message that contains the current working mode: View or Edit.
See also: