Skip to content

Grid Radio Row Selection Mixin

Victor Tomaili edited this page May 3, 2021 · 1 revision

Demo

How to use:

private radRowSelection: Serenity.GridRadioSelectionMixin;

constructor(container: JQuery) {
     super(container);
}

protected createToolbarExtensions() {
     super.createToolbarExtensions();
     this.radRowSelection = new Serenity.GridRadioSelectionMixin(this); 
}

protected getButtons() {
     return [{
          title: 'Test Radio Button',
          cssClass: 'send-button',
          onClick: () => {
               if (!this.onViewSubmit()) {
                    return;
               }
               Q.warning(this.radRowSelection.getSelectedKey());
          }
     }];
}

protected getColumns() {
     var columns = super.getColumns();
     columns.splice(0, 0, Serenity.GridRadioSelectionMixin.createSelectColumn(() => this.radRowSelection));
     return columns;
}
Clone this wiki locally