Categories | Question details Back To List | ||
here is the code i use to create the xml for the grid
function createXmlFileTreeGrid4Filter($filePath, $tree=array(), $fp='', $resetCount=0) { static $callCount = 0; if ( $resetCount ) { $callCount = 0; } $callCount++; if( $callCount == 1 ) { $fp = fopen($filePath, 'w+'); fwrite($fp, '<?xml version='1.0' encoding='utf-8'?>\n'); fwrite($fp, '<rows id='0'>\n'); } foreach ($tree AS $t) { $isAttribute = (substr($t['id'],0,6)=='attrib')?true:false; fwrite($fp,'<row id='' . $t['id'] . '' '.(($t['checked'])?' open='1'':'').'>'); fwrite($fp,'<cell >'.(($t['checked'])?'1':'0').'</cell>'); fwrite($fp,'<cell image=''. $t['img'] .'' >'.$t['name'].'</cell>'); if($isAttribute) { fwrite($fp,'<cell class=\'col_highlight\'>'.(($t['operator'])?$t['operator']:'').'</cell>\n'); fwrite($fp,'<cell class=\'col_highlight\'>'.(($t['value1'])?$t['value1']:'').'</cell>\n'); fwrite($fp,'<cell >'.(($t['value2'])?$t['value2']:'').'</cell>\n'); } if ( count($t['subtree']) ) { createXmlFileTreeGrid4Filter($filePath, $t['subtree'], $fp); } fwrite($fp, '</row>\n'); } if( $callCount == 1 ) { fwrite($fp, '</rows>\n'); chmod($filePath, 0766); fclose($fp); } $callCount--; } Here is the code in css : div.gridbox_light table.obj td.col_highlight { border-width: 1px 1px 1px 1px; border-left: 1px solid #D6D6D6; border-right: 1px solid #D6D6D6; border-top: 1px solid #D6D6D6; border-buttom: 1px solid #D6D6D6; font-family:Tahoma; font-size:11px; padding-right:4px; padding-left:4px; } as you can see fwrite($fp,'<cell >'.(($t['value2'])?$t['value2']:'').'</cell>\n');
meaning the fourth cell has no class=col_highlight (like the previous two) I need this cell to get the class=col_highlight only if the user edits the third cell (not the fourth) on the same row and puts the value 'Between' Answer posted by Support on May 15, 2008 07:28 mygrid.attachEvent("onEditCell",function(stage,id,ind,value){ return true; |