updateSpread {iSPlot}R Documentation

Update any Views that are Spreadsheets

Description

updateSpread is called by the handleMessage method for a gUpdateViewMessage object. If only certain rows need to be updated in the spreadsheet, then the updated information will be placed in only those rows. Otherwise, the whole spreadsheet is redrawn. To tell if only certain rows need to be updated, updateSpread looks at the length of the data parameter. data is expected to be a list with a Rname element, that pertains to row names or indices that need to be updated. data will be a list of length zero if the whole spreadsheet should be redrawn.

Usage

updateSpread(curDataName, spreadIndex, data)

Arguments

curDataName the data set name
spreadIndex the index of the spreadsheet in viewList that needs to be updated - only one spreadsheet can be updated at a time because each data set can only be represented in one spreadsheet
data a list of length zero if the spreadsheet should be redrawn or a list with a Rname element to indicate which rows should be updated

Author(s)

Elizabeth Whalen

See Also

gUpdateViewMessage-class, getRowDataFromDF, createView

Examples

  if (interactive())
  {
    createControlWindow()
    # should load data through Open Data or Open File under the File menu
    data(USArrests)
    loadDFData(USArrests,"USArrests")
    # creating a spreadsheet should occur through View Data under 
    # the Display menu
    createView(type = "spreadView", dataName = "USArrests") 
    # should set the view mode using the View Mode menu
    setHighlightMode()            
    # now click on a row in the spreadsheet and that will cause 
    # updateSpread to be called - you can tell it was called because the 
    # data and thus, the spreadsheet will change  
  }

[Package iSPlot version 1.0.3 Index]