Javascript Object KDFCycler

From KallestadWiki

Jump to: navigation, search

Contents

Overview

The KDFCycler Object manages a results list in coordination with a KDFFieldSet Object. Given a result set (typically a search result), when an item is selected, it's values are pushed to the KDFFieldSet form fields, the KDFFieldSet is cleaned, and the KDFFieldSet default values are re-built. Navigation functions for previous and next item are available as well.

Data Members

The following data elements are associated with each KDFCycler Object.

  • current - the id of the currently selected result
  • items - an array of hashes (I use the term hash interchangeably with associative array). Each item in the array is a record, each hash key is a mapped field id, and each hash value is the value associated with a given mapped field id)
  • fieldset - the KDFFieldSet associated with the KDFCycler Object
  • mapping - a mapping of items[n].keys to KDFFieldSet form field values

Functions

The following functions are associated with each KDFCycler Object.

initialize

Create a new KDFCycler Object Syntax

myCycler = new KDFCycler(fieldset, mapping); 

previtem

Using the SKCycler.current value, move to the next earlier record. (i.e. if 7 is being displayed, move to item 6)

Syntax

myCycler.previtem();

nextitem

Using the KDFCycler.current value, move to the next later record (i.e. if you are looking at record 3, go to record 4)

Syntax

myCycler.nextitem();

setfirst

Sets the value of the fields in a KDFFieldSet object to the first item in the KDFCycler object

Syntax

myCycler.setfirst();

setspec

Sets the fields in a KDFFieldSet object to a specific item in a KDFCycler object

Syntax

myCycler.setspec(index);

Kallestad Development Framework Topics

Personal tools