Skip to main content
madhup0003
December 31, 2024
Question

gridLayout issue

  • 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 above is my code in which i am getting correct data for each task at one row.

but now i have requiremnt where i have to make fvItem 's one task field editable , the current grid design showing in the below image.

so my requirement is like that one task of fv!item's which is PM go design will be editable and the if db have value for this task will be show otherwise user will select date and then on behalf of this date the next task value will be visible eg. If PM GO DESIGN task enddate today then material required date will be +15 days and then next will material required date +21 days etc....

so could anyone help me on this i am not getting any idea.

    3 replies

    kalpeshg0081
    January 8, 2025

    hi [mention:29737913d085458190bfc861db9c1d95:e9ed411860ed4f2ba0265705b8793d05]  

    to make only the PG Go Design column editable and others read only, instead of grid field you can use grid layout and set the value for readonly parameter of the field as below.

    harshas2775
    January 9, 2025

    Firstly, The code you have put does not match with the grid in the attached screenshot. Like I find any line which is responsible for 'PM Go Design' or 'Material Required' column etc.

    Secondly, the requirement part is not very clear. Basis my understanding, you need to make readOnly attribute as false for the PM go Design column. Assuming PM Go Design is a date field then once readonly is false user's will be able to edit it. And basis the date they select , within the saveInto of the datefield you should update the material required date field value. 

    For the value +15,+21 etc we definitely will need more info about requirements. 

    mikes0011
    Brainy
    January 9, 2025
    The code you have put does not match with the grid in the attached screenshot. Like I find any line which is responsible for 'PM Go Design' or 'Material Required' column etc.

    Well, that's incorrect - clearly those columns are being sourced from the list invoked here:

    That then becomes the trouble with the requirement, it'll be very difficult (if possible at all) to pick just one of those columns, make it editable, and have the edit make its way back (correctly) to the original data source.  I'm not sure I have a solution off the top of my head.