RadioButton selection

The single selection can be achieved through radio buttons, which exist on each row instead of using the click event on a specific row. The selection is enabled by setting selectionMode as single on a column level (remember that previously mentioned plain selection works on a table level) and the selection property to hold the selected row as an object.

The component with the radio selection feature to select specific browser records would be written as follows:

<p-dataTable [value]="basicBrowsers" [(selection)]="selectedBrowser">
<p-header> RadioButton selection (Single Selection)</p-header>
<p-column [style]="{'width':'38px'}" selectionMode="single">
</
p-column>
//Content goes here
</p-dataTable>

The following screenshot shows a snapshot result with a radio button selection as an example:

As of now, there is no unselected feature for radio button selection (that is, the row is unselected once you select another row).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.70.101