Added GetFormItemCount() to Form. Resolves #298

This commit is contained in:
Oliver 2019-11-27 19:18:27 +01:00
parent c1775d4e31
commit 9c225ecd57
1 changed files with 9 additions and 3 deletions

12
form.go
View File

@ -296,9 +296,15 @@ func (f *Form) AddFormItem(item FormItem) *Form {
return f
}
// GetFormItem returns the form element at the given position, starting with
// index 0. Elements are referenced in the order they were added. Buttons are
// not included.
// GetFormItemCount returns the number of items in the form (not including the
// buttons).
func (f *Form) GetFormItemCount() int {
return len(f.items)
}
// GetFormItem returns the form item at the given position, starting with index
// 0. Elements are referenced in the order they were added. Buttons are not
// included.
func (f *Form) GetFormItem(index int) FormItem {
return f.items[index]
}