progress.DataSource Class
Data source for progress bars
Item Index
Methods
Events
Methods
getData
()
Success:true, data:
Return data loaded from server
Returns:
getSourceType
()
Return data-source type(HTML or JSON)
Returns:
load
()
Reload data from server Components using this data-source will be automatically updated
Returns:
Attributes
arguments
Array
Array of arguments to send to resource on server
Default: '' Here are some examples: Create a data source for server resource "Person", service name "load" and id : "1". You will then set these config properties:
Example:
"resource": "Person",
"service": "load",
"arguments": [1]
autoload
Boolean
Load data from external source on creation
Default: true
Fires event autoloadChange
Fires when the value for the configuration attribute autoload
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
object postData
Remote postData sent with request, example: postData: { getUsers: 1 }
Fires event object postDataChange
Fires when the value for the configuration attribute object postData
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
shim
Object
Config of shim to show when content is being loaded form server. This config object supports two properties, "renderTo" and "txt". renderTo is optional and specifies where to render the shim. Default is inside body of parent view. "txt" specifies which text to display inside the shim. "txt" can be either a string or a function returning a string.
Example:
shim:{
renderTo:ludo.get('myView').getBody(),
txt : 'Loading content. Please wait'
}
renderTo is optional. Example where "txt" is defined as function:
shim:{
"txt": function(){
var val = ludo.get('searchField).getValue();
return val.length ? 'Searching for ' + val : 'Searching';
}
}
singleton
Boolean
Accept only one data-source of this type. You also need to specify the "type" property which will be used as key in the global SINGELTON cache By using singletons, you don't have to do multiple requests to the server
Fires event singletonChange
Fires when the value for the configuration attribute singleton
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
url
String
optional
Remote url. If not set, global url will be used
Fires event urlChange
Fires when the value for the configuration attribute url
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
Events
failure
Event fired when success parameter in response from server is false
Event Payload:
-
JSON
Objectresponse from server. Error message should be in the "message" property
-
this
ludo.dataSource.JSON