如何获取列表值的总和以及取消选择值后应在本机中减去 [英] How to get sum of list value and after unselect value shoud substract in react native

查看:59
本文介绍了如何获取列表值的总和以及取消选择值后应在本机中减去的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此屏幕中,有两个选项卡:1.INVOICE SPECIFIC和2.AD-HOC. 现在,在1.Invoice SPECIFIC中,我使用复选框映射数组(数组上方")值,其中有一些"data.TransactionAmount",我必须计算所有值的总和并发送到下一个屏幕, 但是,如果我取消选中任何列表金额应减去.例如,有3个值-1050,1050,150 = 3150,如果我取消选中单个值,则应为1050 + 1050 = 2100. 如果我取消单个列表,则所有列表都将变为未选中状态. 2.临时,在这里我可以输入任何数字并发送按钮按下,但是值没有更新,1的制表符正在运行. 请帮忙,谢谢, 下面的链接是我正在执行的操作.

Here in this screen there are two tabs 1.INVOICE SPECIFIC and 2.AD-HOC . Now In 1.Invoice SPECIFIC I am maping array ("above array) value with checkbox ,there are some amout "data.TransactionAmount" I have to calculate the sum of all and send to next screen, but if I uncheck any of the list amount should minus .Like there are 3 values - 1050 ,1050,150 =3150 and if I unchecked single value then it should be 1050+1050=2100. If i am uncheking single list all list is getting unchecked . 2. Ad Hoc , here I can enter any digint and send in button press , but value is not updating ,1 tab value is going . Please help , Thanks , Below link is refrence what i am implementing .

谢谢

推荐答案

我已根据您的要求构建了示例测试应用程序. 它在此存储库中: https://github.com/danZheng1993/sample_for_Abhigyan 请检查

I have built sample test application for your requirements. And it's on this repository: https://github.com/danZheng1993/sample_for_Abhigyan Please check it

这篇关于如何获取列表值的总和以及取消选择值后应在本机中减去的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆