How to create Editable grid with CDT columns along with non CDT column like some Boolean array.

Certified Senior Developer

Hi,

we have requirement like need to create Editable grid with CDT elements along with one non CDT element. 

Example like after all the CDT columns I want to append another column with Non CDT element like Boolean Array element.

Can you please provide some sample example will help us closing this requirement.

Example

 EMPID EMP Name AGE Eligible
 100  ABC 20

Checkbox

200 XYZ 30 Checkbox

here Eligible column is not part of Employee CDT. its Boolean Array. when he selects the Eligible checkbox we need to store the value in to that Array.

 

Thanks in Advance.

 

 

 

  Discussion posts and replies are publicly visible

Parents
  • Hi ramp,

    You can use this code :

    load(
    local!Eligible: repeat(
    count(
    ri!EmployeeCdt
    ),
    null
    ),
    a!gridLayout(
    headerCells: {
    a!gridLayoutHeaderCell(
    label: "Id"
    ),
    a!gridLayoutHeaderCell(
    label: "Name"
    ),
    a!gridLayoutHeaderCell(
    label: "Age"
    ),
    a!gridLayoutHeaderCell(
    label: "Eligible"
    )
    },
    columnConfigs: {
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    ),
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    ),
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    ),
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    )
    },
    rows: a!forEach(
    items: if(
    or(
    isnull(
    ri!EmployeeCdt
    ),
    count(
    ri!EmployeeCdt
    ) < 1
    ),
    {},
    1 + enumerate(
    count(
    ri!EmployeeCdt
    )
    )
    ),
    expression: a!gridRowLayout(
    contents: {
    a!textField(
    label: "EMPID",
    labelPosition: "ABOVE",
    value: ri!EmployeeCdt[fv!item].EMPID,
    saveInto: ri!EmployeeCdt[fv!item].EMPID,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "EMP Name",
    labelPosition: "ABOVE",
    value: ri!EmployeeCdt[fv!item].EMPName,
    saveInto: ri!EmployeeCdt[fv!item].EMPName,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "Age",
    labelPosition: "ABOVE",
    value: ri!EmployeeCdt[fv!item].Age,
    saveInto: ri!EmployeeCdt[fv!item].Age,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!checkboxField(
    label: "Eligible",
    choiceLabels: {
    "Yes",
    "No"
    },
    choiceValues: {
    "Yes",
    "No"
    },
    value: local!Eligible[fv!item],
    saveInto: local!Eligible[fv!item]
    )
    }
    )
    )
    )
    )

    Hope it will help
Reply
  • Hi ramp,

    You can use this code :

    load(
    local!Eligible: repeat(
    count(
    ri!EmployeeCdt
    ),
    null
    ),
    a!gridLayout(
    headerCells: {
    a!gridLayoutHeaderCell(
    label: "Id"
    ),
    a!gridLayoutHeaderCell(
    label: "Name"
    ),
    a!gridLayoutHeaderCell(
    label: "Age"
    ),
    a!gridLayoutHeaderCell(
    label: "Eligible"
    )
    },
    columnConfigs: {
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    ),
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    ),
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    ),
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    )
    },
    rows: a!forEach(
    items: if(
    or(
    isnull(
    ri!EmployeeCdt
    ),
    count(
    ri!EmployeeCdt
    ) < 1
    ),
    {},
    1 + enumerate(
    count(
    ri!EmployeeCdt
    )
    )
    ),
    expression: a!gridRowLayout(
    contents: {
    a!textField(
    label: "EMPID",
    labelPosition: "ABOVE",
    value: ri!EmployeeCdt[fv!item].EMPID,
    saveInto: ri!EmployeeCdt[fv!item].EMPID,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "EMP Name",
    labelPosition: "ABOVE",
    value: ri!EmployeeCdt[fv!item].EMPName,
    saveInto: ri!EmployeeCdt[fv!item].EMPName,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!textField(
    label: "Age",
    labelPosition: "ABOVE",
    value: ri!EmployeeCdt[fv!item].Age,
    saveInto: ri!EmployeeCdt[fv!item].Age,
    refreshAfter: "UNFOCUS",
    validations: {}
    ),
    a!checkboxField(
    label: "Eligible",
    choiceLabels: {
    "Yes",
    "No"
    },
    choiceValues: {
    "Yes",
    "No"
    },
    value: local!Eligible[fv!item],
    saveInto: local!Eligible[fv!item]
    )
    }
    )
    )
    )
    )

    Hope it will help
Children
No Data