jQWidgets Forums

jQuery UI Widgets Forums Grid OnChange event for cell?

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 9 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • OnChange event for cell? #82987

    Hi,

    I’m using Jqxgrid, where i have Quantity, UnitPrice & TotalPrice, columns.
    on editing quantity col, i want to use ‘OnChange’ event to effect the value in TotalPrice col.

    I tried using oncellendedit, but by using this, when user change the of quantity col, it is not changing/effect the TotalPrice col value. User have
    to click out the quantity col then it is changing/effecting the value in TotalPrice.

    But i’m looking for the ‘onchange’ event, so, as soon as, user change value it should simultaneously effect the totalprice col value.

    Please help me

    
    
    $("#jqxgrid").on('cellendedit', function (event) {
                            var args = event.args;
                            var columnDataField = args.datafield;
                            var rowIndex = args.rowindex;
                            var cellValue = args.value;
                            var oldValue = args.oldvalue;
                            //alert('b4 calc');
                            if (columnDataField == "Quantity") {
                                //alert('InCal');
                                var qty = cellValue;
                                var updateTP = null;
                                var UP = $("#jqxgrid").jqxGrid('getcellvalue', rowIndex, 'UnitPrice');
                                if (qty != null) {
                                    //alert('Qty: ' + qty + ',UP: ' + UP);
                                    updateTP = qty * UP;
                                    $("#jqxgrid").jqxGrid('setcellvalue', rowIndex, 'TotalPrice', updateTP);
                                    UpdateDataToSave();
                                }
                            }
                        });
    OnChange event for cell? #83012

    Peter Stoev
    Keymaster

    Hi ABDUL SUBHA MOHAMMED,

    The Grid has cellvaluechanged event: http://jsfiddle.net/jqwidgets/ejvnb/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.