使用MEF时是否有任何棱镜“后构建”事件或方法?(Are there any Prism “Post-build” Event or method while using MEF?)
我在一个类中有4个以上的导入属性,而一些代码至少需要执行4个属性
是否有任何PRISM或MEF事件可以帮助而不是在每个setter上放置通知然后检查空值?
I have 4+ imported properties in a class and some code that needs at least 4 properties to execute
Are there any PRISM or MEF events that would help instead of putting notify on each setter and then checking for nulls ?
原文:https://stackoverflow.com/questions/8301608
满意答案
我发现的第一个也是最明显的错误是命令“add + = parseFloat(this.value);” 不起作用。
正确的功能如下:
function calculateRow() { alert("GAYA"); console.log("2"); var add = 0; $(".qty").each(function() { add += parseFloat($(this).val()); // <-- changed from this.value if (isNaN(add)) { $('#total').val("0"); } else { $('#total').val(add.toFixed(2)); } }); }
您还必须更改以下行
$('#detail').on('keyup', '.qty', calculateRow());
至
$('#detail').on('keyup', '.qty', calculateRow);
Tthe first and most obvious error I found was that the command "add += parseFloat(this.value);" does not work.
The correct functions would be the following:
function calculateRow() { alert("GAYA"); console.log("2"); var add = 0; $(".qty").each(function() { add += parseFloat($(this).val()); // <-- changed from this.value if (isNaN(add)) { $('#total').val("0"); } else { $('#total').val(add.toFixed(2)); } }); }
You also have to change the following row from
$('#detail').on('keyup', '.qty', calculateRow());
to
$('#detail').on('keyup', '.qty', calculateRow);
相关问答
更多根据动态添加的字段计算值(Calculating values based on dynamically added fields)
jQuery不适用于动态添加的表格行(jquery doesn't work on dynamically added table rows)
在servlet中获取动态添加的表值(Get the dynamically added table values in servlet)
如何使用jquery计算动态添加的表行的值的值(how to count the values of the values of the dynamically added table rows using jquery)
在ajax中验证来自外部php的动态添加的表行值(Validating dynamically added table row values from external php in ajax)
如何使用jquery删除jsp中新添加的行中的先前行值(how to remove the previous rows values in the newly added rows in jsp using jquery)
基于来自其他表的值计算(*)行(Count (*) rows based on values from other table)
我动态添加的表行未出现在我的应用中(My dynamically added table rows are not appearing in my app)
jQuery-动态地将具有不同id的表行的输入值相乘(jQuery- Dynamically multiply input values of table rows with different id)
如何获取使用Jquery动态添加的HTML表行记录?(How to get the HTML Table row records which is added dynamically using Jquery?)
相关文章
更多Solr参数(DisMax Event Facet)
storm事件管理器EventManager源码分析-event.clj
研磨设计模式之工厂方法模式(Factory Method)-模式讲解1
研磨设计模式之工厂方法模式(Factory Method)-模式讲解2
研磨设计模式之工厂方法模式(Factory Method)-场景问题
研磨设计模式之工厂方法模式(Factory Method)-模式讲解3
研磨设计模式之工厂方法模式(Factory Method)-解决方案
redhat6.4上build storm 0.9.0.1
struts1 怎么在action中获取页面post的参数
【Hadoop】Build and Run HDFS
最新问答
更多如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
linux的常用命令干什么用的
由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
如何交换返回集中的行?(How to swap rows in a return set?)
在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
Java中的不可变类(Immutable class in Java)
WordPress发布查询(WordPress post query)
如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!