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
            )
    
    )

  • 0
    Certified Senior Developer
    in reply to Vinay Kumar Rai
    Hi,

    Here I am getting "Interface Definition: Expression evaluation error at function 'todatasubset' [line 29]: An invalid start index of 0 was passed in. Start indices must be greater or equal to 1."

    my Rule Input is: employee CDT
    MyBooleanValues:{true,false,true}

    local!SelectedIndexArray: where(
    ri!MyBooleanValues
    ),

    local!GridPagingInfo: a!gridSelection(
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 7
    ),
    selected: local!SelectedIndexArray
    ),
    local!datasubset:todatasubset(ri!employeeCDT,local!GridPagingInfo),

    rule input contails 10 rows.

    can your help me on this why its not working.

    -Regards,
    Ram Kumar.
  • use this

    local!datasubset:todatasubset(ri!employeeCDT,local!GridPagingInfo.pagingInfo)
Reply Children
No Data