RevisionsPanel.refreshListBox

Syntax

refreshListBox (fireSelectionEvent);

Parameters

fireSelectionEvent. Determines whether to fire the event that occurs on selecting a revisions list item. If this parameter True the event should be fired, and otherwise if the parameter is False.

Description

The refreshListBox method refreshes the list in accordance with the revision collection named this._Revisions.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:

var revisionsButt = new PP.Ui.Button({
	ParentNode: document.body, //DOM parent node
	Content: "Change Sorting", //Text      
	Click: PP.Delegate(onClickRevisions)     
	}); 
var dialogShown = False;
function onClickRevisions()
	{
//Get revisions panel for database
var rubKey = 112;
var wbkPB = workbookBox.getPropertyBarView();
var panels = wbkPB._selfNavItems;
var revisionsPanel = null;
var i;
for (i = 0; i < panels.length; i++)
	{
		if (panels[i]._GroupName == PP.TS.Ui.PropertyGroups.RubricatorRevisions && panels[i].getTag() == rubKey)
			{
				revisionsPanel = wbkPB._selfNavItems[i];
				break;
			}
	}
var orderType = revisionsPanel._OrderType;		
//Set sorting of revisions
switch (orderType)
	{
		case PP.TS.Ui.WbkRevisionsOrder.ByName:
			revisionsPanel._sortRevision(PP.TS.Ui.WbkRevisionsOrder.ByDate);
			break;
		case PP.TS.Ui.WbkRevisionsOrder.ByDate:
			revisionsPanel._sortRevision(PP.TS.Ui.WbkRevisionsOrder.ByName)
			break;
	}
//Refreshed the list according to the collection of revisions
revisionsPanel.refreshListBox();
//Get key of the factor directory, which revisions are displayed in the component
var rub = revisionsPanel.getRubKey();
//Get array of revisions, which are displayed in the component
var revs = revisionsPanel.getRevisions();
revs = revs.length;
	if (!dialogShown)	
		{
			alert("Factor directory key:      " + rub + '\n' +
			"Number of displayed revisions:" + revs);
			dialogShown = True;
		}
	}

After executing the example the WorkbookBox component and a button named Change Sorting are placed in the HTML page. To execute the example, select the Data tab in the workbook side panel, open the Basic panel and click the button. After this revision sorting changes and a message appears in the screen. This message contains the number of displayed revisions and the key of time series database.

See also:

RevisionsPanel