Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObservableArrayがデータモデルに属していて、beginUpdate()が呼ばれている時、ObservableArrayのchangeイベントはデータモデルマネージャのendUpdate()呼び出し時まで上がらないようにする #264

Closed
fukudayasuo opened this issue Jan 17, 2014 · 1 comment
Assignees
Milestone

Comments

@fukudayasuo
Copy link

データモデルマネージャーのbeginUpdate()が呼ばれているとき、そのマネージャに属するデータモデルのデータアイテム内のObservableArrayについて、今は変更時に即座にchangeイベントが発火する。これを、endUpdate()が呼ばれたときにまとめてchangeイベントをあげるように変更する。

fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Jan 20, 2014
@fukudayasuo
Copy link
Author

対応しました。
なお、ObservableArrayのchangeBeforeイベントの発火はbegin-endUpdateの影響は受けません。

今回の対応での仕様変更、及びそれに伴う仕様変更は以下の通りです。

  • DataItemが持つObservableArrayのプロパティのchangeイベントは、DataItemが属しているDataManagerのbeginUpate/endUpdateの制御を受け、endUpdate()時にイベントが上がるようになりました。
  • endUpdate時に上がるObservableArrayのchangeイベントのイベントオブジェクトは以下のようになります。
{
    type: 'change',
    method: null,
    args: null,
    returnValue: null
}
  • view.bind()を使ってDataItem内のObservableArrayがビューにバインドされていて、beginUpdate()が呼ばれている時、バインドされているObservableArrayの変更に伴うビューの変更は、endUpdate()のタイミングで行われるようになりました。

fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Jan 21, 2014
ObservableArray単体及びDataItemに属するObservableArrayのchangeBefore,changeイベントについてのテストを追加
@simdy simdy added this to the v1.1.9 milestone Feb 25, 2014
@simdy simdy added bug and removed bug labels Feb 25, 2014
@simdy simdy closed this as completed Feb 25, 2014
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Mar 4, 2014
リファクタ。endUpdate時にObsAryのchangeイベントをあげるかどうかを引数で渡していましたが、managerにフラグを持たせるようにしました。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants