Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82794

Value not saved

$
0
0

Hi all,

I use an editor to allow user to edit order lines. if user changes the order quantity, then the order amount will be computed (order quantity * unit price) again. But the amount can not be updated to my MS SQL database after editing.
Can anyone tell me what i am missing? I am using inline editing.

editor.on('preSubmit', function (e, o, action) {
if (action !== 'remove') {
var orderQuantity = this.field('orderQuantity');
var unitPrice = this.field('unitPrice');
var amount = this.field('amount');

                amount.val(parseFloat(orderQuantity.val()) * parseFloat(unitPrice.val()));
                alert(amount.val().toString());
                editor.submit(); 
                // If any error was reported, cancel the submission so it can be corrected
                if (this.inError()) {
                    return false;
                }
            }
        });

Thanks.

Best regards,
Tom Leong


Viewing all articles
Browse latest Browse all 82794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>