Skip to main content
madhup0003
December 31, 2024
Question

dateField

  • December 31, 2024
  • 3 replies
  • 0 views

 

  a!gridLayout(
                      labelPosition: "ABOVE",

                      headerCells: {
                        a!gridLayoutHeaderCell(label: "Reference Number"),
                        a!gridLayoutHeaderCell(label: "SiteID"),
                         
                        a!gridLayoutHeaderCell(label: "Activity"), 
                        a!gridLayoutHeaderCell(label: "Structure Type"), 
                        

                        a!flatten(a!forEach(
                          items: local!TaskParagraphCDT.TaskName,
                          expression:   
                          {
                            /*a!gridLayoutHeaderCell(label: fv!item & " Status"),*/
                            a!gridLayoutHeaderCell(label: fv!item),
                           
                          } 
                        )),
                        a!gridLayoutHeaderCell(label: "Rule"),
                      },
                      columnConfigs: {                            
                        /*a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1),*/
                        a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1),
                        a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1),
                        a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1),
                        a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1),
                      

                        a!forEach(
                          items: local!taskIds,
                          expression: {
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 1)
                          }
                          /*a!gridLayoutHeaderCell(label: fv!item & " End Date")*/


                        )
                      },
                      rows: 
                      a!forEach(
                        items: local!selectedActivity,
                        expression: with(
                          local!item:fv!item,
                          a!gridRowLayout(
                            contents: {
                              a!textField(
                                value: fv!item.referenceNumber,
                                saveInto: fv!item.referenceNumber,
                                readOnly: true
                              ),
                              a!textField(
                                value: fv!item.siteID ,
                                saveInto:fv!item.siteID,
                                readOnly: true
                              ),
                             
                              a!textField(
                                value: fv!item.activityName,
                                saveInto:fv!item.activityName,
                                readOnly: true
                              ),
                              a!textField(
                                value: fv!item.structureType,
                                saveInto:fv!item.structureType,
                                readOnly: true
                              ),

                              { 
                                a!forEach( 
                                  items: local!TaskParagraphCDT.TaskID,
                                  expression:{
                                    /*a!textField(                                         */
                                      /*value:local!TaskParagraphCDT[fv!index].Status[wherecontains(tostring(local!item.referenceNumber),touniformstring(ri!ForecastDataValue.referenceNumber))],*/
                                      /*readOnly: true*/
                                    /*),*/
                                    a!textField(
                                      value: local!TaskParagraphCDT[fv!index].EndDate[wherecontains(tostring(local!item.referenceNumber),touniformstring(local!selectedActivity.referenceNumber))],
                                      readOnly: true,                                
                                    ),
                                    /*a!dateField(*/
                                      /*value:  */
                                      /*local!TaskParagraphCDT[fv!index].EndDate[wherecontains(tostring(local!item.referenceNumber),touniformstring(local!selectedActivity.referenceNumber))],*/
                                      /*readOnly: true,*/
                                    /*)*/
                                  }
                                )
                              },
                              a!textField(
                                value:{},
                                saveInto:{},
                                readOnly: true
                              ),

                            }
                          ) 

                        )
                      ),

                      height:"TALL",
                      spacing: "STANDARD",
                      rowHeader: 1
                    )

Hi All i have upload my code for grid layout.

In which i am stuck at point, requirement is,  if you see the code you will find that we have one gridlayout where we are showing  data , in the last a!forEach(
items: local!TaskParagraphCDT.TaskID,
expression:{}) i have one field which is text field where i am getting fv!item data which is fine, and all columns of that data is holding date values so now i have requirement on that particular  in fv!item there are seven task data, one for task which PM GO Design , wo i have to make this task column field editable and on the behalf of this particular date value other task date will be auto ajust like if 

pm go design task enddate is today so the next Material Required task date will be +15 days....next Construction Start date will the material required task date +21 days then etc.....

i have to make the grid like below.

here are data structure values.

    3 replies

    July 20, 2025

    Hi [mention:29737913d085458190bfc861db9c1d95:e9ed411860ed4f2ba0265705b8793d05] , 

    You can try the below approach to fix this:

    1. Create local variable for date calculation and to calculate dependent dates.
    2. Configure the readOnly parameter on your specific column by  putting the condition as below
      { readOnly: not(fv!item.taskName = "PM GO Design"),}

      Let me know if that helps.
    harshas2775
    July 21, 2025

    just noticed this is a very old post

    July 21, 2025

    It was unanswered... although it might have been resolved but still in case someone else may encounter the same issue in future...they can refer this