EasyUI Forum
May 11, 2024, 02:14:23 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: please help me  (Read 6537 times)
pedroc
Newbie
*
Posts: 17


View Profile
« 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
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 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.
Logged
pedroc
Newbie
*
Posts: 17


View Profile
« Reply #2 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
« Last Edit: May 27, 2015, 07:56:48 AM by pedroc » Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #3 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.
Logged
pedroc
Newbie
*
Posts: 17


View Profile
« Reply #4 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!