Default selection of a paging grid while loading?

Certified Senior Developer

Hi we have requirement like CDT values coming from the Process to display in Paging grid with some Boolean array variable which specified what rows need to be checked.

Can some one guide me how to select the rows defaults with that Boolean array variable. like we have 3 rows and Boolean array contains {ture,false,true}. then we need to select the first and 3rd row automatically in the SAIL interface. similarly if the user modified the selection those selection needs to store in the same Boolean array and send it back to Process. example like initially 1st and 3rd got selected... now user changed the selection to 2nd and 3rd row. now the Array will be like {false,true,true}.

Working sample is much helpful in this case.

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • =load(
    
       local!AllIndexArray: 1 + enumerate(count(ri!YourCDT)),
       
       local!SelectedIndexArray: where(ri!MyBooleanValues) /* {true,false,true} */
       
       /* In a!gridSelection you can specify the default selection*/
       
       local!GridPagingInfo: a!gridSelection(
                                  pagingInfo: a!pagingInfo(
                                    startIndex: 1,
                                    batchSize: 10
                                  ),
                                  selected: local!SelectedIndexArray
                                ),
                                
                                
         local!dataSubset: todatasubset(ri!YourCDT,local!GridPagingInfo),
         
           a!gridField(
              totalCount: local!datasubset.totalCount,
              columns: {
                /* Your columns */
              },
              identifiers: local!AllIndexArray,
              value: local!GridPagingInfo,
              saveInto: {
                local!GridPagingInfo,
                a!save(local!SelectedIndexArray,save!value.selected)
              },
              selection: true
            )
    
    )

Reply
  • =load(
    
       local!AllIndexArray: 1 + enumerate(count(ri!YourCDT)),
       
       local!SelectedIndexArray: where(ri!MyBooleanValues) /* {true,false,true} */
       
       /* In a!gridSelection you can specify the default selection*/
       
       local!GridPagingInfo: a!gridSelection(
                                  pagingInfo: a!pagingInfo(
                                    startIndex: 1,
                                    batchSize: 10
                                  ),
                                  selected: local!SelectedIndexArray
                                ),
                                
                                
         local!dataSubset: todatasubset(ri!YourCDT,local!GridPagingInfo),
         
           a!gridField(
              totalCount: local!datasubset.totalCount,
              columns: {
                /* Your columns */
              },
              identifiers: local!AllIndexArray,
              value: local!GridPagingInfo,
              saveInto: {
                local!GridPagingInfo,
                a!save(local!SelectedIndexArray,save!value.selected)
              },
              selection: true
            )
    
    )

Children