Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dojox/data/CsvStore.js

  • Provides:

    • dojox.data.CsvStore
  • Requires:

    • dojo.data.util.filter in common
    • dojo.data.util.simpleFetch in common
  • dojox.data.CsvStore

    • type
      Function
    • chains:
      • dojo.data.util.simpleFetch: (prototype)
    • parameters:
      • keywordParameters: (typeof Object)
        identifier: String} The column label for the column to use for the identity.  Optional.  If not set, the identity is the row number.
    • summary
      The CsvStore implements the dojo.data.api.Read API and reads
      data from files in CSV (Comma Separated Values) format.
      All values are simple string values. References to other items
      are not supported as attribute values in this datastore.
      
      Example data file:
      name, color, age, tagline
      Kermit, green, 12, "Hi, I'm Kermit the Frog."
      Fozzie Bear, orange, 10, "Wakka Wakka Wakka!"
      Miss Piggy, pink, 11, "Kermie!"
      
      Note that values containing a comma must be enclosed with quotes ("")
      Also note that values containing quotes must be escaped with two consecutive quotes (""quoted"")
      
      examples:
      var csvStore = new dojox.data.CsvStore({url:"movies.csv");
      var csvStore = new dojox.data.CsvStore({url:"http://example.com/movies.csv");
  • dojox.data.CsvStore.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • keywordParameters: (typeof Object)
        identifier: String} The column label for the column to use for the identity.  Optional.  If not set, the identity is the row number.
    • summary
      initializer
  • dojox.data.CsvStore.url

    • tags: public
    • type
      string
    • summary
      Declarative hook for setting Csv source url.
  • dojox.data.CsvStore.label

    • tags: public
    • type
      string
    • summary
      Declarative hook for setting the label attribute.
  • dojox.data.CsvStore.identifier

    • tags: public
    • type
      string
    • summary
      Declarative hook for setting the identifier.
  • dojox.data.CsvStore.separator

    • tags: public
    • type
      string
    • summary
      Parameter to allow specifying if preventCache should be passed to
      the xhrGet call or not when loading data from a url.
      Note this does not mean the store calls the server on each fetch,
      only that the data load has preventCache set as an option.
  • dojox.data.CsvStore.urlPreventCache

    • type
      bool
  • dojox.data.CsvStore._assertIsItem

    • parameters:
      • item: (typeof item)
        The item to test for being contained by the store.
    • summary
      This function tests whether the item passed in is indeed an item in the store.
    • type
      Function
  • dojox.data.CsvStore._getIndex

    • parameters:
      • item: (typeof The)
        idem handle to get the index for.
    • summary
      Internal function to get the internal index to the item data from the item handle
    • type
      Function
  • dojox.data.CsvStore.getValue

    • parameters:
      • item: (typeof item)
      • attribute: (typeof attribute)
        || attribute-name-string
      • defaultValue: (typeof value)
    • returns
      String
    • summary
      See dojo.data.api.Read.getValue()
      Note that for the CsvStore, an empty string value is the same as no value,
      so the defaultValue would be returned instead of an empty string.
    • type
      Function
  • dojox.data.CsvStore.getValues

    • parameters:
      • item: (typeof item)
      • attribute: (typeof attribute)
        || attribute-name-string
    • returns
      Array
    • summary
      See dojo.data.api.Read.getValues()
      CSV syntax does not support multi-valued attributes, so this is just a
      wrapper function for getValue().
    • type
      Function
  • dojox.data.CsvStore.getAttributes

    • parameters:
      • item: (typeof item)
    • returns
      Array
    • summary
      See dojo.data.api.Read.getAttributes()
    • type
      Function
  • dojox.data.CsvStore.hasAttribute

    • parameters:
      • item: (typeof item)
      • attribute: (typeof attribute-name-string)
    • returns
      Boolean
    • summary
      See dojo.data.api.Read.hasAttribute()
      The hasAttribute test is true if attribute has an index number within the item's array length
      AND if the item has a value for that attribute. Note that for the CsvStore, an
      empty string value is the same as no value.
    • type
      Function
  • dojox.data.CsvStore.containsValue

    • parameters:
      • item: (typeof item)
      • attribute: (typeof attribute)
        || attribute-name-string
      • value: (typeof anything)
    • returns
      boolean.
    • summary
      See dojo.data.api.Read.containsValue()
    • type
      Function
  • dojox.data.CsvStore._containsValue

    • parameters:
      • item: (typeof item)
        The data item to examine for attribute values.
      • attribute: (typeof attribute)
        The attribute to inspect.
      • value: (typeof anything)
        The value to match.
      • regexp: (typeof RegExp)
        Optional regular expression generated off value if value was of string type to handle wildcarding.
        If present and attribute values are string, then it can be used for comparison instead of 'value'
    • returns
      Boolean
    • summary
      Internal function for looking at the values contained by the item.
    • description
      Internal function for looking at the values contained by the item.  This
      function allows for denoting if the comparison should be case sensitive for
      strings or not (for handling filtering cases where string case should not matter)
    • tags:
    • type
      Function
  • dojox.data.CsvStore.isItem

    • parameters:
      • something: (typeof anything)
    • returns
      Boolean
    • summary
      See dojo.data.api.Read.isItem()
    • type
      Function
  • dojox.data.CsvStore.isItemLoaded

    • parameters:
      • something: (typeof anything)
    • returns
      Boolean
    • summary
      See dojo.data.api.Read.isItemLoaded()
      The CsvStore always loads all items, so if it's an item, then it's loaded.
    • type
      Function
  • dojox.data.CsvStore.loadItem

    • parameters:
      • item: (typeof item)
    • summary
      See dojo.data.api.Read.loadItem()
    • description
      The CsvStore always loads all items, so if it's an item, then it's loaded.
      From the dojo.data.api.Read.loadItem docs:
      If a call to isItemLoaded() returns true before loadItem() is even called,
      then loadItem() need not do any work at all and will not even invoke
      the callback handlers.
    • type
      Function
  • dojox.data.CsvStore.getFeatures

    • returns
      Object
    • summary
      See dojo.data.api.Read.getFeatures()
    • type
      Function
  • dojox.data.CsvStore.getLabel

    • parameters:
      • item: (typeof item)
    • returns
      String|undefined
    • summary
      See dojo.data.api.Read.getLabel()
    • type
      Function
  • dojox.data.CsvStore.getLabelAttributes

    • parameters:
      • item: (typeof item)
    • returns
      array|null
    • summary
      See dojo.data.api.Read.getLabelAttributes()
    • type
      Function
  • dojox.data.CsvStore._fetchItems

    • parameters:
      • keywordArgs: (typeof Object)
      • findCallback: (typeof Function)
      • errorCallback: (typeof Function)
    • summary
      See dojo.data.util.simpleFetch.fetch()
    • tags:
    • type
      Function
  • dojox.data.CsvStore._loadInProgress

    • type
      bool
  • dojox.data.CsvStore._csvData

    • type
      Object
  • dojox.data.CsvStore.close

    • parameters:
      • request: (typeof dojo.data.api.Request)
        || keywordArgs || null
    • summary
      See dojo.data.api.Read.close()
    • type
      Function
  • dojox.data.CsvStore._getArrayOfArraysFromCsvFileContents

    • parameters:
      • csvFileContents: (typeof string)
    • returns
      null
    • summary
      Parses a string of CSV records into a nested array structure.
    • description
      Given a string containing CSV records, this method parses
      the string and returns a data structure containing the parsed
      content.  The data structure we return is an array of length
      R, where R is the number of rows (lines) in the CSV data.  The
      return array contains one sub-array for each CSV line, and each
      sub-array contains C string values, where C is the number of
      columns in the CSV data.
    • example
      For example, given this CSV string as input:
      "Title, Year, Producer \n Alien, 1979, Ridley Scott \n Blade Runner, 1982, Ridley Scott"
      this._dataArray will be set to:
      [["Alien", "1979", "Ridley Scott"],
      ["Blade Runner", "1982", "Ridley Scott"]]
      And this._attributes will be set to:
      ["Title", "Year", "Producer"]
      And this._attributeIndexes will be set to:
      { "Title":0, "Year":1, "Producer":2 }
    • tags:
    • type
      Function
  • dojox.data.CsvStore._attributes

    • type
      Array
  • dojox.data.CsvStore._dataArray

    • type
      Array
  • dojox.data.CsvStore._splitLines

    • parameters:
      • csvContent
    • summary
      Function to split the CSV file contents into separate lines.
      Since line breaks can occur inside quotes, a Regexp didn't
      work as well.  A quick passover parse should be just as efficient.
    • tags:
    • type
      Function
  • dojox.data.CsvStore._processData

    • parameters:
      • data: (typeof String)
        The CSV data.
    • summary
      Function for processing the string data from the server.
    • tags:
    • type
      Function
  • dojox.data.CsvStore._arrayOfAllItems

    • type
      Array
  • dojox.data.CsvStore._loadFinished

    • type
      bool
  • dojox.data.CsvStore._createItemFromIdentity

    • parameters:
      • identity: (typeof String)
        The identity
    • returns
      Object
    • summary
      Function for creating a new item from its identifier.
    • tags:
    • type
      Function
  • dojox.data.CsvStore.getIdentity

    • parameters:
      • item: (typeof item)
    • returns
      String|null
    • summary
      See dojo.data.api.Identity.getIdentity()
    • tags: public
    • type
      Function
  • dojox.data.CsvStore.fetchItemByIdentity

    • parameters:
      • keywordArgs: (typeof Object)
    • summary
      See dojo.data.api.Identity.fetchItemByIdentity()
    • tags: public
    • type
      Function
  • dojox.data.CsvStore.getIdentityAttributes

    • parameters:
      • item: (typeof item)
    • summary
      See dojo.data.api.Identity.getIdentifierAttributes()
    • tags: public
    • type
      Function
  • dojox.data.CsvStore._handleQueuedFetches

    • summary
      Internal function to execute delayed request in the store.
    • tags:
    • type
      Function
  • dojox.data.CsvStore._queuedFetches

    • type
      Array
  • dojox.data.CsvStore._attributeIndexes

    • type
      Object
  • dojox.data.CsvStore._storeProp

    • type
      String
  • dojox.data.CsvStore._idProp

    • type
      String
  • dojox.data.CsvStore._features

    • type
      Object
  • dojox.data.CsvStore._idMap

    • type
      Object
  • dojox.data

    • type
      Object
  • dojox

    • type
      Object