flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Gottfried <p...@digillax.com>
Subject Re: Show two rows diferences in Adv Datagrid
Date Fri, 24 Jul 2015 18:36:29 GMT
I would try something like this, if the data shown is the way the data is stored in the data
provider and no server update is needed.
also assumes there will always be a row with 10,15 and diff in the data provider and they
are in proper order.

on a datagrid cell edit end event, get the current row info and update the data provider.

public function  editCellEnd(e:DataGridEvent):void
{
    if(e.reason=="cancelled") {
        return;
    }
    var dsRowIndex:int = e.rowIndex;
    var dsFieldName:String = e.dataField;
    var dsColumnIndex:Number = e.columnIndex;

    var vo:* = griddataArr[dsRowIndex];
    
    var col:DataGridColumn = diffdataGrid.columns[dsColumnIndex];
    var newvalue:String = diffdataGrid.itemEditorInstance[col.editorDataField];
    if(newvalue=="" || newvalue==null) {
        e.preventDefault();
        return;
    }
    var oldvalue=vo[col.editorDataField];
  //  trace(“editend:" + dsRowIndex + ", " + dsFieldName + ", " + dsColumnIndex);
    var row10:Number;
    var row15:Number;
    var rowDiff:Number;
    var sanity:Boolean;	
	if(oldvalue != newvalue ) {//only update if item changed, could put checks for data validation
		griddataArr[dsRowIndex][col.editorDataField]= newvalue;//put the changed value in data provider
		if(vo.Key_ID==“10”) {
			row10= dsRowIndex;
			row15= dsRowIndex+1;
			rowDiff= dsRowIndex+2;
		}
		if(vo.Key_ID==“15”) {
			row10= dsRowIndex-1;
			row15= dsRowIndex;
			rowDiff= dsRowIndex+2;
		}
		if(vo.Key_ID==“Diff”) {
			row10= dsRowIndex-2;
			row15= dsRowIndex-1;
			rowDiff= dsRowIndex;
		}
		griddataArr[rowDiff][‘FY_01’]= kinQqlxTicketsdataArr[row10][‘FY_01’]-kinQqlxTicketsdataArr[row15][‘FY_01’];
	}
}


Phil Gottfried
Digillax Systems
1207 Oakwood Trail
Southlake, TX 76092
817-488-9271
phil@digillax.com



> On Jul 24, 2015, at 12:01 PM, Deepak MS <megharajdeepak@gmail.com> wrote:
> 
>> FY_01


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message