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 |
dataHandler |
function | Custom function which receives data from server and returns data in appropriate format for the data source. |
- 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: