Implem / Implem.Pleasanter

Pleasanter is a no-code/low-code development platform that runs on .NET. You can quickly create business applications with simple operations.
https://pleasanter.org
GNU Affero General Public License v3.0
511 stars 81 forks source link

複数の項目の値を結合し1つの項目に自動入力できない #395

Closed ebessan closed 1 year ago

ebessan commented 2 years ago

公式サイト「FAQ:サンプルコード:複数の項目の値を結合し1つの項目に自動入力したい」 を参考にスクリプトを登録しましたが、数値項目で計算ができません。結果から、テキストになっているのかと思います。 どなたか原因はわかりますか?

スクリプトは以下の通りで、数値Gを変更すると計算しようとしています。

数値D、数値G、数値I、数値J、数値K、数値Lを用意

(入力値) 数値D : 空 数値G : 90 数値I : 100 数値J : 0 数値K : 0 数値L : 計算式(数値I + 数値J + 数値K)

(スクリプト1) $(document).on('change', '#Issues_NumG', function() { var I = $('#Issues_NumI').val(); var J = $('#Issues_NumJ').val(); var K = $('#Issues_NumK').val(); var sum = I + J + K $p.set($('#Issues_NumD'), sum); }); (スクリプト1の結果) 数値D = 10000

上記でダメだったので、下記でも試しましたが、計算したり、しなかったりになります。

(スクリプト2) let $G = $p.getControl('NumG'); let $L = $p.getControl('NumL');

$G.change(function () { $p.set($p.getControl('NumD'), $L.val() * ( 1 - $G.val() / 100)); }); (スクリプト2の結果) 数値D = 10 もしくは計算しない。。。

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.