Quintiq file version 2.0
#parent: ListScenario
Response OnDrawElement (
  Scenario element
) id:Response_ListScenario_OnDrawElement
{
  #keys: '[11766.1.296637665]'
  Body:
  [*
    // Draw a selected dataset image for scenario selected - Macro plan
    idx := 0;
    
    if( exists( DataHolderForScenarioComparison.Data(), Elements, e, true, e.MDSID() = element.DatasetMDSID() ) )
    {
      drawinfo.Image(idx, "TABLES");
    }
    
    
    idx := 1;
    //additional match SelectionScenario is to fix the refresh of check mark in thin client as the datasetmdsid doesn't work for thin client
    if ( not isnull( MacroPlan )
              and not isnull ( SelectionScenario.Data() )
              and element = DataHolderActiveScenario.Data() )
    {
      drawinfo.Image(idx, "check2" );
    }
    else if ( not element.IsLoaded() )
    {
      drawinfo.Image(idx, "DATA_DOWN");
    }
    else
    {
      drawinfo.Image(idx, "");
    }
    
    //draw the loading icon when loading in progress
    idx := 2;
    if( element.IsLoadingInProgress() )
    {
      drawinfo.Image( idx, "DATA_UP" );
    }
  *]
  DefinitionID: 'Responsedef_List_OnDrawElement'
}
