2014-09-04 2 views
2

에 두 개의 필드와 쇼를 SUM, 나는 조금 문제가있어 내가 사이에 수학 연산을 수행 할 그리드검도 UI : 내가 현재 검도 UI를 사용하고 제 3 일

schema: 
           { 
            data: "data", 
            total: function(response) 
            { 
             return response.data.length; 
            }, 
            model: 
            { 
              id: "id", 
              fields: 
              { 
               clasificacion  :{editable: false}, 
               tipo_rubros  :{editable: false }, 
               rubro    :{editable: false }, 
               proveedor_rubro :{editable:false }, 
               valor    :{editable: false ,type:"number"}, 
               num_factura  :{editable: true }, 
               neto    :{editable: true ,type:"number"}, 
               iva    :{editable: true ,type:"number"}, 
               observacion  :{editable: true }, 
               fecha_factura  :{editable: true }, 
              } 
            }      
           }, 
            group: { 

             field: "tipo_rubros", aggregates: [ 
             { field: "valor", aggregate: "sum"} 
             ] 
            }, 
           aggregate: [ { field: "valor", aggregate: "sum" }, 
           ] 
         }, 

을 가지고하는 방법 "neto"와 "iva"그리고 실시간으로 대답은 "valor"필드에 나타납니다.

의견이 있으십니까?

답변

0

그리드에 대한 저장 기능을 구현해야합니다. 셀 값을 변경하고 Enter 키를 누르면 해고됩니다. 귀하의 질문은 전체 소스 코드를 포함하지 않지만, 구현이이 같은해야한다 :

save: function (e) { 
    yourDataSource.valor = e.model.neto + e.model.iva; 
    yourGrid.data('kendoGrid').dataSource.read(); 
    yourGrid.data('kendoGrid').refresh(); 
} 

는 희망이 도움이됩니다.