extjs 獲取grid所有行,獲取store行字段數據,合計


  1. extjs 獲取grid所有行
    var grid = filed.findParentByType('panel');
    var rows =  grid.store.getData().items;
    

      

  2. 獲取store行字段數據
    store.getAt(0).get('finalAmount');
    

      

  3. 合計
    features: [{
            ftype: 'summary',//計算公式行
            dock: 'bottom'//至於底部合計
        }],
    	sunmmaryType:'sum' //頁面計算
    	summaryRenderer: function (value) {//行數據
                    return this.getView().store.data.items[0].data.sumAmount
                }
    

      

  4. Extjs actioncolumn動態顯示按鈕
    通過getClass方法可以獲取到,當前行的數據,根據指定字段的值可以判斷設置按鈕的顯示或隱藏。
    {
        text: '操作',  xtype: 'actioncolumn', align: 'center', menuDisabled:true, flex:0.5, items:[{
            tooltip: '查詢',
            getClass : function (v, metadata, r, rowIndex, colIndex, store) {
                if(recValid == 'N'){
                    return 'x-hidden';
                }
                var data = r.raw.matchFlag;
                if(data== "PMIS"){
                    return 'x-hidden';
                }
                return "doc_lines";
            }
        }]
    }
    

      


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM