EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: pedroc on May 27, 2015, 06:33:33 AM



Title: please help me
Post by: pedroc on May 27, 2015, 06:33:33 AM
I wrote two post and I have not received any reply. I need to do is add up all the values in a column when the OnChange of a given cell is triggered. I am using a datagrid. this text was translated by google, I do not speak English


Title: Re: please help me
Post by: jarry on May 27, 2015, 06:59:10 AM
You need to describe your question clearly. Providing some code snippets or pictures may be more suitable.


Title: Re: please help me
Post by: pedroc on May 27, 2015, 07:55:10 AM
in the previous post is the code. then I put an image to have an idea.
what I want is that the onChange element of column 'A' the following calculation is made:
all elements of D = Sum of C / Sum column B


Title: Re: please help me
Post by: jarry on May 27, 2015, 08:54:01 AM
Please refer to this tutorial http://www.jeasyui.com/tutorial/datagrid/datagrid15.php.

If you only want to update a row, please call 'updateRow' or 'refreshRow' methods instead.


Title: Re: please help me
Post by: pedroc on May 28, 2015, 05:41:40 AM
onBeginEdit:function(rowIndex){
        var editors = $('#tt').datagrid('getEditors', rowIndex);
        var n1 = $(editors[0].target);
        var n2 = $(editors[1].target);
        var n3 = $(editors[2].target);
        n1.add(n2).numberbox({
            onChange:function(){
                var cost = n1.numberbox('getValue')*n2.numberbox('getValue');
                n3.numberbox('setValue',cost);
            }
        })
}
I UNDERSTAND THE EXAMPLE But in my case n3 INSTEAD OF BEING A ROW CELL IS ALL A COLUMN EDITED AND DO NOT REFER TO IT AS TO EDIT YOUR VALUE