avair

avair

  • NA
  • 40
  • 2.6k

Unable to find add and remove labels with checkboxes

May 23 2023 9:52 AM

Below is my code to add Add and Remove labels dynamically based on user selection setting the value works but i am unable to see Add and Remove labels with checkboxes. Can anyone let me know the solution

function dynamicBinding() {
    var var= Ext.getCmp('students').query('[isCheckbox]');
    var grid = Ext.getCmp('grdStudents');
    grid.on('selectionchange', function () {
        var Count = grid.getSelectionModel().getCount();
        var totalCount = grid.getStore().getCount();

        if (Count === totalCount) {
            var.setText = 'Remove';
            var.setValue = true;
        } else {
            var.setText = 'Add';
            var.setValue = false;
        }
    });  
}

 


Answers (1)