src/ui/radio-set/smart-radio-set.component.ts
selector | smart-radio-set |
styleUrls | ./smart-radio-set.component.css |
templateUrl | ./smart-radio-set.component.html |
Properties |
Methods |
|
Inputs |
Outputs |
Accessors |
constructor(elementRef: ElementRef)
|
||||||
Parameters :
|
enabled |
Type : boolean
|
id |
Type : string
|
orientation |
Type : string
|
smartModel |
Type : string
|
style |
Type : any
|
value-list |
Type : string[]
|
smartModelChange |
Type : EventEmitter<string>
|
Public onValueChanged |
onValueChanged(event: any, key: string)
|
Returns :
void
|
visible |
Default value : true
|
enabled | ||||||
getenabled()
|
||||||
Returns :
boolean
|
||||||
setenabled(value: boolean)
|
||||||
Parameters :
Returns :
void
|
ngModel | ||||||
getngModel()
|
||||||
Returns :
string
|
||||||
setngModel(value: string)
|
||||||
Parameters :
Returns :
void
|
radioItems | ||||||
getradioItems()
|
||||||
Returns :
RadioItem[]
|
||||||
setradioItems(value: [])
|
||||||
Parameters :
Returns :
void
|
<div [ngClass]="{ 'k-form-field': true, vertical: orientation === 'vertical', horizontal: orientation === 'horizontal' }" [ngStyle]="style || {}" [hidden]="!visible" >
<div *ngFor="let r of radioItems; let i = index;" [class]="orientation">
<input type="radio" name="group" [id]="'radio'+i" class="k-radio" [value]="r.key" [disabled]="!enabled" (change)="onValueChanged($event, r.key)" [ngModel]="ngModel"/>
<label class="k-radio-label" [for]="'radio'+i">{{r.value}}</label>
</div>
</div>
./smart-radio-set.component.css
.horizontal {
display: inline;
}
.k-form-field.vertical {
display: block !important;
}