refresh (args);
args. Parameter that determines what to be refreshed.
The refresh method refreshes specified workbook elements.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and replace the document opening code with the following one in the document opening event handler:
var setTableStyleButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Set Table Style", //text Click: PP.Delegate(onClickSetTableStyle) }); function onClickSetTableStyle() { var report = args.Workbook; var metadata = { Name: "EAX table style", PredefinedStyle: "ExtRedStriped" }; //Set style var pattern = {}; pattern.gridStyle = { parts: { it: ["Table"] } }; pattern.filter = True; pattern.grid = True; pattern.pivot = True; //Create body of server request var body = { SetEaxMd: { tEax: report.getOdId(), tArg: { pattern: pattern, meta: { grid: { style: { table: metadata } } }, refresh: { fetchData: False, grid: True }, metaGet: tsService._getDefaultMetaGet() } } }; callback = tsService._visitCallback(PP.Delegate(onTableStyle)); tsService._send(body, callback); } //setTableStyle method execution end event handler function onTableStyle(sender, args){ var res = JSON.parse(args.ResponseText); var metadata = { Name: "Eax table style", PredefinedStyle: "ExtRedStriped", Response: res } //Create an object of the PP.Mb.Ui.PropertyChangedEventArgs class to be used //as a parameter for the refresh method var arguments = new PP.Mb.Ui.PropertyChangedEventArgs({ PropertyName: "RibbonTableStyle", Metadata: metadata, TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.Table, PP.Exp.Ui.ViewTypeUpdate.Ribbon] }); //Refresh the specified workbook elements workbookBox.getDataView().refresh(arguments); }
After executing the example the HTML page will contain the WorkbookBox component and a button named Set Table Style. On clicking this button workbook is refreshed and selected with red color.
See also: