ludo.dataSource.Base

ludo.dataSource.


new ludo.dataSource.Base(url, postData, autoload, singleton, dataHandler)

Base class for data sources

Parameters:
Name Type Description
url String

URL for the data source

postData Object

Data to post with the request, example: postData: { getUsers: ' }

autoload Boolean

Load data from server when the datasource is instantiated.

singleton Boolean

True to make a data source singleton. This is something you do if you create
your own data sources and only want one instance of it. To make this work, your datasource needs to have a
type attribute. Example:

myApp.dataSource.Countries = new Class({ type:'datasourceCountries'

dataHandler function

Custom function which receives data from server and returns data in appropriate format for the data source.
If this function returns false, it will trigger the fail event.

Source:

Extends

  • ludo.Core,

Methods


getData() → {Object|Array}

Return data loaded from server

Source:
Returns:
Type
Object | Array

getSourceType()

Return data-source type(HTML or JSON)

Source:
Returns:

string source type


hasData() → {Boolean}

Has data loaded from server

Source:
Returns:
Type
Boolean

loadUrl(url)

Load content from a specific url

Parameters:
Name Type Description
url
Source:

sendRequest(service, arguments, data)

Send a new request

Parameters:
Name Type Description
service String
arguments Array
data Object
Source: