API Docs for: 0.13.12
Show:

store.Base Class

Extends class.Base
Defined in: src\firebrick.js:3466
Module: Firebrick.class

Extends

Methods

destroy

()

remove data

getData

() Object

Returns the store data attribute

Returns:

Object:

store data

getRawData

(
  • initial
)
Object

provide the raw data

Parameters:

  • initial Boolean

    [default=false] (optional) set to true if you want the original data passed to setData() - if left out or false - it will parse the ko-ed data back to a JS object

Returns:

Object:

getUrl

(
  • type
)
String

return the correct url when getting or submitting the store

Parameters:

  • type String

    optional - "get", "submit"

Returns:

String:

init

()

Called on creation

load

(
  • options
)
Object

Load the store - see data.store:loadStore

Parameters:

  • options Object

Returns:

Object:

self

Example:

    load({
               callback:function(){},
               scope:this //scope for callback
           })

setData

(
  • data
)
Object

Converts a json object into stores with records

Parameters:

  • data Object

Returns:

Object:

self

submit

() Object

Submit the store data to the specified url.submit path see data.store:submit

Returns:

Object:

self

toJson

() String

Convert store data to json string

Returns:

String:

json

toPlainObject

() Object

convert store data to a plain object

Returns:

Object:

Properties

_initialData

Object private

initial raw data that was passed when setting the store with setData() function

Default: null

async

Boolean

default value

Default: true

autoLoad

Boolean

load store on creation

Default: false

data

Object

data store - use setData()

Default: null

dataInitialised

Boolean private

Whether the data in the store has been initialised, ie. convert to records etc.

Default: false

dataType

String

Default store configurations any types that jQuery allows in $.ajax()

Default: "json"

get

String

Default: null

isStore

Boolean private

Simple property to check whether this object is a store

Default: true

loadProtocol

String

set the connection protocol, POST or GET for load

Default: "GET"

params

Object

pass parameters when loading the store

Default: null

root

String

specify a root - used when calling getData()

Default: null

status

String private

Store status

  1. initial :: store has just been created
  2. preload :: store is just about to fire the $.ajax event
  3. any :: success status of $.ajax()

stringifyData

Boolean

Default: true

submit

String

Default: null

submitProtocol

String

set the connection protocol, POST or GET for submit

Default: "POST"

url

String, Object string :: only a get store - i.e. 1-way store, get information from the server. object :: mutliple directional store - get and send information to and from the server

URL Config:

Example:

 url: "/getusers.php"
     url: {
                   get:"/getusers.php",
                   submit: "/saveusers.php"
               }