0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

テーブル全選択チェックボックスのClient Action

Posted at

こちらの動画を参考にしながらテーブルに選択と全選択のチェックボックスを追加しましたが、一つシンプルにできるところがあったので紹介します。
(テーブルに選択と全選択のチェックボックス追加はこちらの動画を御覧下さい。)
https://www.youtube.com/watch?v=uP9vJVH8PsY

この動画ではAggregateのListをFor Eachしながら、全選択のVariable(BooleanVar)がTrueならIsSelectにTrueをセット、FalseならFalseをセットとしているのですが、それならIfを使わずにBooleanVarを直接入れればいいやん。というClient Actionになります。
image.png
私は選択削除の為にチェックボックスを使いましたが、最初Client ActionのFor EachでDeleteEntityのServer Actionを呼び出し、1つずつIdを渡して消すという処理にしてしまいました。すると動作はしますがこれ
image.png
消えない波線、Performance WarningとSecutiry Warningです。
image.png
ここからWargingの提案に従い、Listで渡してのServer Actionにしていくわけですが、ここでもうひとつ。
動画ではAggreateにIsSelectを追加していまいしたが、私は誤ってEntityにIsSelectを追加していました。
本来EntityのAttributeは記録の為ですが、結果的にこれが設計の為のAttributeとして機能して約に立った気がします。
(2桁の年やパック10進数といういにしえ?の知識があるともったいない気もしてしまいますが)

またこれでWarningの提案に従えば、波線は消せるという認識が持てるようになりました。
(今ひとつこれとは別に消せない波線がありますが、それはまたにします。)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?