문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top