Author Topic: checkbox and getCheckedNodes  (Read 622 times)

ibizlink

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 8
    • View Profile
checkbox and getCheckedNodes
« on: January 19, 2022, 10:07:10 am »
Hi ,

I am using checkbox and render it as per below.

In UI, it works as checked but when I use getCheckedNodes, it returns null value.
(All checked in checkbox in UI but no return for getCheckedNodes)

Am i missing something here?



 render: function (ui) {
                            const cards = $this.variables.vSetIDs ?? [];
                            let checked = '';
                            if (ui.cellData == null) {
                                //init
                                if (cards.includes(ui.rowData.cardid)) {
                                    checked = 'checked';
                                }
                            }
                            else {
                                if (ui.cellData) {
                                    checked = 'checked';
                                }
                            }

                            return {
                                text: "<label><input type='checkbox' " + checked + "/></label>"
                            }
                        }

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: checkbox and getCheckedNodes
« Reply #1 on: January 19, 2022, 11:57:05 am »
Checkbox(dataIndx).getCheckedNodes method works with checkbox columns created by defining column.cb property.

https://paramquery.com/pro/api#option-column-cb

Examples:

https://paramquery.com/pro/demos/checkbox

https://paramquery.com/pro/demos/selection_checkbox