Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181350

Dashcode Widgets Datasource

I would like to know if there is a Reference manual somewhere for Dashcode 3.0 Widgets' datasources.

I need to know the following:

  1. How to refresh (requery) a datasource
  2. How to listen for datasource events (onsuccess, onerror)
  3. How to pass parameter to datasource query

It's being very difficult for me to find this very basic information in Apple's documentation.

Thanks a lot.

Upvotes: 1

Views: 1320

Answers (2)

Alnitak
Alnitak

Reputation: 339917

To answer #3, to pass a parameter to the datasource query:

ds = dashcode.getDataSource("mydatasource");
ds.setValueForKeyPath("1", "parameters.count");
ds.setValueForKeyPath("bar", "parameters.foo");

will add ?count=1&foo=bar to the query URL.

For #1, an answer I saw whilst searching this topic was to add an additional parameter which you change for each query to trigger a requery:

ds.setValueForKeyPath(update++, "parameters.update");

I still need to know the answer to #2 myself.

Upvotes: 1

jcb344
jcb344

Reputation: 323

This is not the most complete guid but it does do over reloading datasources.

Upvotes: 1

Related Questions