Documentation ¶
Overview ¶
генерация форм на основе типов полей таблиц БД
Index ¶
- Constants
- func AnotherSignUpForm(placeholder string) string
- func GetLengthFromType(dataType string) (width int, size int)
- func RenderCheckBox(key, val, title string, idx int, checked, required, events, dataJson string) string
- func SignUpForm(placeholder string) string
- func StreamAnotherSignUpForm(qw422016 *qt422016.Writer, placeholder string)
- func StreamRenderCheckBox(qw422016 *qt422016.Writer, key, val, title string, idx int, ...)
- func StreamSignUpForm(qw422016 *qt422016.Writer, placeholder string)
- func StyleInput(dataType string) string
- func WriteAnotherSignUpForm(qq422016 qtio422016.Writer, placeholder string)
- func WriteRenderCheckBox(qq422016 qtio422016.Writer, key, val, title string, idx int, ...)
- func WriteSignUpForm(qq422016 qtio422016.Writer, placeholder string)
- type AnotherMarshalRow
- type AnotherPersonData
- type BlockColumns
- type Button
- type ColumnDecor
- func (col *ColumnDecor) Copy() *ColumnDecor
- func (col *ColumnDecor) DataForJSON() string
- func (col *ColumnDecor) GetFields(columns []dbEngine.Column) []interface{}
- func (col *ColumnDecor) GetValues() (values []interface{})
- func (col *ColumnDecor) InputName(i int) string
- func (col *ColumnDecor) InputTypeForJSON() string
- func (col *ColumnDecor) Pattern() string
- func (col *ColumnDecor) Placeholder() string
- func (col *ColumnDecor) RenderAttr(i int) string
- func (col *ColumnDecor) RenderInputs() string
- func (col *ColumnDecor) StreamDataForJSON(qw422016 *qt422016.Writer)
- func (col *ColumnDecor) StreamInputTypeForJSON(qw422016 *qt422016.Writer)
- func (col *ColumnDecor) StreamRenderAttr(qw422016 *qt422016.Writer, i int)
- func (col *ColumnDecor) StreamRenderInputs(qw422016 *qt422016.Writer)
- func (col *ColumnDecor) Type() string
- func (col *ColumnDecor) WriteDataForJSON(qq422016 qtio422016.Writer)
- func (col *ColumnDecor) WriteInputTypeForJSON(qq422016 qtio422016.Writer)
- func (col *ColumnDecor) WriteRenderAttr(qq422016 qtio422016.Writer, i int)
- func (col *ColumnDecor) WriteRenderInputs(qq422016 qtio422016.Writer)
- type FieldStructure
- func (fieldStrc *FieldStructure) GetColumnTitles() (titleFull, titleLabel, placeholder, pattern, dataJson string)
- func (field *FieldStructure) GetListJSON(key, val, required, events, dataJson string)
- func (field *FieldStructure) GetOptions(tableName, val string)
- func (field *FieldStructure) GetOptionsJson(tableName string)
- func (fieldStrc *FieldStructure) GetTitle(field db.FieldStructure) string
- func (fieldStrc *FieldStructure) RenderDateAttributtes() string
- func (field *FieldStructure) RenderEnum(key, val, required, events, dataJson string) (result string)
- func (field *FieldStructure) RenderForeignSelect(tablePrefix, key, val, titleLabel, required, events, dataJson string) string
- func (fieldStrc *FieldStructure) RenderInputFromType(nameInput, val, title, placeholder, pattern, required, events, dataJson string) string
- func (field *FieldStructure) RenderMultiSelect(ns *FieldsTable, tablePrefix, key, val, titleLabel, required string) string
- func (field *FieldStructure) RenderParentSelect(nameTable, key, val, titleLabel, required, events, dataJson string) string
- func (field *FieldStructure) RenderSet(key, val, required, events, dataJson string) (result string)
- func (field *FieldStructure) RenderTable(ns *FieldsTable, tablePrefix, key, val, titleLabel, required string) string
- func (field *FieldStructure) Scan(value interface{}) error
- func (fieldStrc *FieldStructure) StreamRenderDateAttributtes(qw422016 *qt422016.Writer)
- func (field *FieldStructure) StreamRenderForeignSelect(qw422016 *qt422016.Writer, ...)
- func (fieldStrc *FieldStructure) StreamRenderInputFromType(qw422016 *qt422016.Writer, ...)
- func (field *FieldStructure) StreamRenderMultiSelect(qw422016 *qt422016.Writer, ns *FieldsTable, ...)
- func (field *FieldStructure) StreamRenderParentSelect(qw422016 *qt422016.Writer, ...)
- func (field *FieldStructure) StreamRenderTable(qw422016 *qt422016.Writer, ns *FieldsTable, ...)
- func (field *FieldStructure) TypeInput() string
- func (fieldStrc *FieldStructure) WriteRenderDateAttributtes(qq422016 qtio422016.Writer)
- func (field *FieldStructure) WriteRenderForeignSelect(qq422016 qtio422016.Writer, ...)
- func (fieldStrc *FieldStructure) WriteRenderInputFromType(qq422016 qtio422016.Writer, ...)
- func (field *FieldStructure) WriteRenderMultiSelect(qq422016 qtio422016.Writer, ns *FieldsTable, ...)
- func (field *FieldStructure) WriteRenderParentSelect(qq422016 qtio422016.Writer, ...)
- func (field *FieldStructure) WriteRenderTable(qq422016 qtio422016.Writer, ns *FieldsTable, ...)
- type FieldsTable
- func (fields *FieldsTable) AppendNewFieldRows(fields1 FieldsTable, args ...interface{})
- func (ns *FieldsTable) FindField(name string) *FieldStructure
- func (fields *FieldsTable) PutDataFrom(ns db.FieldsTable)
- func (ns *FieldsTable) ShowAnyForm(Action, Title string) string
- func (fields *FieldsTable) ShowRecord(id string) string
- func (ns *FieldsTable) StreamShowAnyForm(qw422016 *qt422016.Writer, Action, Title string)
- func (fields *FieldsTable) StreamShowRecord(qw422016 *qt422016.Writer, id string)
- func (ns *FieldsTable) WriteShowAnyForm(qq422016 qtio422016.Writer, Action, Title string)
- func (fields *FieldsTable) WriteShowRecord(qq422016 qtio422016.Writer, id string)
- type FormField
- func (f *FormField) FormHTML(blocks ...BlockColumns) string
- func (f *FormField) FormJSON(blocks ...BlockColumns) string
- func (f *FormField) RenderForm(isHTML bool, blocks ...BlockColumns) string
- func (f *FormField) StreamFormHTML(qw422016 *qt422016.Writer, blocks ...BlockColumns)
- func (f *FormField) StreamFormJSON(qw422016 *qt422016.Writer, blocks ...BlockColumns)
- func (f *FormField) StreamRenderForm(qw422016 *qt422016.Writer, isHTML bool, blocks ...BlockColumns)
- func (f *FormField) WriteFormHTML(qq422016 qtio422016.Writer, blocks ...BlockColumns)
- func (f *FormField) WriteFormJSON(qq422016 qtio422016.Writer, blocks ...BlockColumns)
- func (f *FormField) WriteRenderForm(qq422016 qtio422016.Writer, isHTML bool, blocks ...BlockColumns)
- type MarshalRow
- type PersonData
- type SignForm
Constants ¶
const CELL_SELECT = `<td class="%s"><select name="%s:%s" class="">%s</select></td>`
const CELL_TABLE = `<td class="%s"><input type="%s" name="%s:%s" value="%s"/></td>`
Variables ¶
This section is empty.
Functions ¶
func AnotherSignUpForm ¶
func GetLengthFromType ¶
минимальный размер поля для разных типов полей
func RenderCheckBox ¶
func SignUpForm ¶
func StreamAnotherSignUpForm ¶
func StreamRenderCheckBox ¶
func StreamSignUpForm ¶
func StyleInput ¶
старый метод, обсолете, буду избавляться TODO старый метод, обсолете, буду избавляться
func WriteAnotherSignUpForm ¶
func WriteAnotherSignUpForm(qq422016 qtio422016.Writer, placeholder string)
func WriteRenderCheckBox ¶
func WriteRenderCheckBox(qq422016 qtio422016.Writer, key, val, title string, idx int, checked, required, events, dataJson string)
func WriteSignUpForm ¶
func WriteSignUpForm(qq422016 qtio422016.Writer, placeholder string)
Types ¶
type AnotherMarshalRow ¶
type AnotherPersonData ¶
type AnotherPersonData struct { Id int Login string Email string Sex int Rows []MarshalRow }
func (*AnotherPersonData) JSON ¶
func (d *AnotherPersonData) JSON() string
func (*AnotherPersonData) StreamJSON ¶
func (d *AnotherPersonData) StreamJSON(qw422016 *qt422016.Writer)
func (*AnotherPersonData) WriteJSON ¶
func (d *AnotherPersonData) WriteJSON(qq422016 qtio422016.Writer)
type BlockColumns ¶ added in v1.0.330
type BlockColumns struct { Buttons []Button Columns []*ColumnDecor Id int Multiple bool Title, Description string }
type ColumnDecor ¶ added in v1.0.322
type ColumnDecor struct { dbEngine.Column IsHidden, IsReadOnly, IsSlice bool InputType string SelectOptions map[string]string PatternList dbEngine.Table PatternName string PlaceHolder string LinkNew string Label string Value interface{} // contains filtered or unexported fields }
func NewColumnDecor ¶ added in v1.0.3393
func NewColumnDecor(column dbEngine.Column, patternList dbEngine.Table) *ColumnDecor
func (*ColumnDecor) Copy ¶ added in v1.0.11512
func (col *ColumnDecor) Copy() *ColumnDecor
func (*ColumnDecor) DataForJSON ¶ added in v1.0.3397
func (col *ColumnDecor) DataForJSON() string
func (*ColumnDecor) GetFields ¶ added in v1.0.3397
func (col *ColumnDecor) GetFields(columns []dbEngine.Column) []interface{}
func (*ColumnDecor) GetValues ¶ added in v1.0.322
func (col *ColumnDecor) GetValues() (values []interface{})
func (*ColumnDecor) InputName ¶ added in v1.0.322
func (col *ColumnDecor) InputName(i int) string
func (*ColumnDecor) InputTypeForJSON ¶ added in v1.0.3397
func (col *ColumnDecor) InputTypeForJSON() string
func (*ColumnDecor) Pattern ¶ added in v1.0.322
func (col *ColumnDecor) Pattern() string
func (*ColumnDecor) Placeholder ¶ added in v1.0.324
func (col *ColumnDecor) Placeholder() string
func (*ColumnDecor) RenderAttr ¶ added in v1.0.3397
func (col *ColumnDecor) RenderAttr(i int) string
func (*ColumnDecor) RenderInputs ¶ added in v1.0.322
func (col *ColumnDecor) RenderInputs() string
func (*ColumnDecor) StreamDataForJSON ¶ added in v1.0.3397
func (col *ColumnDecor) StreamDataForJSON(qw422016 *qt422016.Writer)
func (*ColumnDecor) StreamInputTypeForJSON ¶ added in v1.0.3397
func (col *ColumnDecor) StreamInputTypeForJSON(qw422016 *qt422016.Writer)
func (*ColumnDecor) StreamRenderAttr ¶ added in v1.0.3397
func (col *ColumnDecor) StreamRenderAttr(qw422016 *qt422016.Writer, i int)
func (*ColumnDecor) StreamRenderInputs ¶ added in v1.0.322
func (col *ColumnDecor) StreamRenderInputs(qw422016 *qt422016.Writer)
func (*ColumnDecor) Type ¶ added in v1.0.322
func (col *ColumnDecor) Type() string
func (*ColumnDecor) WriteDataForJSON ¶ added in v1.0.3397
func (col *ColumnDecor) WriteDataForJSON(qq422016 qtio422016.Writer)
func (*ColumnDecor) WriteInputTypeForJSON ¶ added in v1.0.3397
func (col *ColumnDecor) WriteInputTypeForJSON(qq422016 qtio422016.Writer)
func (*ColumnDecor) WriteRenderAttr ¶ added in v1.0.3397
func (col *ColumnDecor) WriteRenderAttr(qq422016 qtio422016.Writer, i int)
func (*ColumnDecor) WriteRenderInputs ¶ added in v1.0.322
func (col *ColumnDecor) WriteRenderInputs(qq422016 qtio422016.Writer)
type FieldStructure ¶
type FieldStructure struct { Table *FieldsTable COLUMN_NAME string DATA_TYPE string COLUMN_DEFAULT string IS_NULLABLE string CHARACTER_SET_NAME string COLUMN_COMMENT string COLUMN_TYPE string CHARACTER_MAXIMUM_LENGTH int Value string IsHidden bool InputType string CSSClass string CSSStyle string TableName string Events map[string]string Where string Figure string Placeholder string Pattern string MinDate string MaxDate string BeforeHtml string Html string AfterHtml string ForeignFields string LinkTD string DataJSOM map[string]interface{} EnumValues []string }
Сия структура нужна для подготовки к отображению поля на форме (возможо, в таблице и еще других компонентах веб-старницы) На данный момент создается на лету, в будущем TODO: перенести в сервис отдачи структур и сделать независемым от реализации СУБД
func (*FieldStructure) GetColumnTitles ¶
func (fieldStrc *FieldStructure) GetColumnTitles() (titleFull, titleLabel, placeholder, pattern, dataJson string)
func (*FieldStructure) GetListJSON ¶
func (field *FieldStructure) GetListJSON(key, val, required, events, dataJson string)
func (*FieldStructure) GetOptions ¶
func (field *FieldStructure) GetOptions(tableName, val string)
func (*FieldStructure) GetOptionsJson ¶
func (field *FieldStructure) GetOptionsJson(tableName string)
func (*FieldStructure) GetTitle ¶
func (fieldStrc *FieldStructure) GetTitle(field db.FieldStructure) string
func (*FieldStructure) RenderDateAttributtes ¶
func (fieldStrc *FieldStructure) RenderDateAttributtes() string
func (*FieldStructure) RenderEnum ¶
func (field *FieldStructure) RenderEnum(key, val, required, events, dataJson string) (result string)
func (*FieldStructure) RenderForeignSelect ¶
func (field *FieldStructure) RenderForeignSelect(tablePrefix, key, val, titleLabel, required, events, dataJson string) string
func (*FieldStructure) RenderInputFromType ¶
func (fieldStrc *FieldStructure) RenderInputFromType(nameInput, val, title, placeholder, pattern, required, events, dataJson string) string
func (*FieldStructure) RenderMultiSelect ¶
func (field *FieldStructure) RenderMultiSelect(ns *FieldsTable, tablePrefix, key, val, titleLabel, required string) string
func (*FieldStructure) RenderParentSelect ¶
func (field *FieldStructure) RenderParentSelect(nameTable, key, val, titleLabel, required, events, dataJson string) string
func (*FieldStructure) RenderSet ¶
func (field *FieldStructure) RenderSet(key, val, required, events, dataJson string) (result string)
func (*FieldStructure) RenderTable ¶
func (field *FieldStructure) RenderTable(ns *FieldsTable, tablePrefix, key, val, titleLabel, required string) string
func (*FieldStructure) Scan ¶
func (field *FieldStructure) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*FieldStructure) StreamRenderDateAttributtes ¶
func (fieldStrc *FieldStructure) StreamRenderDateAttributtes(qw422016 *qt422016.Writer)
func (*FieldStructure) StreamRenderForeignSelect ¶
func (field *FieldStructure) StreamRenderForeignSelect(qw422016 *qt422016.Writer, tablePrefix, key, val, titleLabel, required, events, dataJson string)
func (*FieldStructure) StreamRenderInputFromType ¶
func (fieldStrc *FieldStructure) StreamRenderInputFromType(qw422016 *qt422016.Writer, nameInput, val, title, placeholder, pattern, required, events, dataJson string)
func (*FieldStructure) StreamRenderMultiSelect ¶
func (field *FieldStructure) StreamRenderMultiSelect(qw422016 *qt422016.Writer, ns *FieldsTable, tablePrefix, key, val, titleLabel, required string)
func (*FieldStructure) StreamRenderParentSelect ¶
func (field *FieldStructure) StreamRenderParentSelect(qw422016 *qt422016.Writer, nameTable, key, val, titleLabel, required, events, dataJson string)
func (*FieldStructure) StreamRenderTable ¶
func (field *FieldStructure) StreamRenderTable(qw422016 *qt422016.Writer, ns *FieldsTable, tablePrefix, key, val, titleLabel, required string)
func (*FieldStructure) TypeInput ¶
func (field *FieldStructure) TypeInput() string
стиль показа для разных типов полей новый метод, еще обдумываю
func (*FieldStructure) WriteRenderDateAttributtes ¶
func (fieldStrc *FieldStructure) WriteRenderDateAttributtes(qq422016 qtio422016.Writer)
func (*FieldStructure) WriteRenderForeignSelect ¶
func (field *FieldStructure) WriteRenderForeignSelect(qq422016 qtio422016.Writer, tablePrefix, key, val, titleLabel, required, events, dataJson string)
func (*FieldStructure) WriteRenderInputFromType ¶
func (fieldStrc *FieldStructure) WriteRenderInputFromType(qq422016 qtio422016.Writer, nameInput, val, title, placeholder, pattern, required, events, dataJson string)
func (*FieldStructure) WriteRenderMultiSelect ¶
func (field *FieldStructure) WriteRenderMultiSelect(qq422016 qtio422016.Writer, ns *FieldsTable, tablePrefix, key, val, titleLabel, required string)
func (*FieldStructure) WriteRenderParentSelect ¶
func (field *FieldStructure) WriteRenderParentSelect(qq422016 qtio422016.Writer, nameTable, key, val, titleLabel, required, events, dataJson string)
func (*FieldStructure) WriteRenderTable ¶
func (field *FieldStructure) WriteRenderTable(qq422016 qtio422016.Writer, ns *FieldsTable, tablePrefix, key, val, titleLabel, required string)
type FieldsTable ¶
type FieldsTable struct { Name string ID int Comment string IsDadata bool Rows []FieldStructure Hiddens map[string]string SaveFormEvents map[string]string DataJSOM map[string]interface{} }
func (*FieldsTable) AppendNewFieldRows ¶
func (fields *FieldsTable) AppendNewFieldRows(fields1 FieldsTable, args ...interface{})
AppendNewFieldRows - Добаляет в fields поля из других таблиц @version 1.00 2017-05-13 @author Serg Litvinov
func (*FieldsTable) FindField ¶
func (ns *FieldsTable) FindField(name string) *FieldStructure
func (*FieldsTable) PutDataFrom ¶
func (fields *FieldsTable) PutDataFrom(ns db.FieldsTable)
заполняет структуру для формы данными, взятыми из структуры БД
func (*FieldsTable) ShowAnyForm ¶
func (ns *FieldsTable) ShowAnyForm(Action, Title string) string
func (*FieldsTable) ShowRecord ¶
func (fields *FieldsTable) ShowRecord(id string) string
func (*FieldsTable) StreamShowAnyForm ¶
func (ns *FieldsTable) StreamShowAnyForm(qw422016 *qt422016.Writer, Action, Title string)
func (*FieldsTable) StreamShowRecord ¶
func (fields *FieldsTable) StreamShowRecord(qw422016 *qt422016.Writer, id string)
func (*FieldsTable) WriteShowAnyForm ¶
func (ns *FieldsTable) WriteShowAnyForm(qq422016 qtio422016.Writer, Action, Title string)
func (*FieldsTable) WriteShowRecord ¶
func (fields *FieldsTable) WriteShowRecord(qq422016 qtio422016.Writer, id string)
type FormField ¶ added in v1.0.330
type FormField struct {
Title, Action, Method, Description string
}
func (*FormField) FormHTML ¶ added in v1.0.331
func (f *FormField) FormHTML(blocks ...BlockColumns) string
func (*FormField) FormJSON ¶ added in v1.0.330
func (f *FormField) FormJSON(blocks ...BlockColumns) string
func (*FormField) RenderForm ¶ added in v1.0.11512
func (f *FormField) RenderForm(isHTML bool, blocks ...BlockColumns) string
func (*FormField) StreamFormHTML ¶ added in v1.0.331
func (f *FormField) StreamFormHTML(qw422016 *qt422016.Writer, blocks ...BlockColumns)
func (*FormField) StreamFormJSON ¶ added in v1.0.330
func (f *FormField) StreamFormJSON(qw422016 *qt422016.Writer, blocks ...BlockColumns)
func (*FormField) StreamRenderForm ¶ added in v1.0.11512
func (f *FormField) StreamRenderForm(qw422016 *qt422016.Writer, isHTML bool, blocks ...BlockColumns)
func (*FormField) WriteFormHTML ¶ added in v1.0.331
func (f *FormField) WriteFormHTML(qq422016 qtio422016.Writer, blocks ...BlockColumns)
func (*FormField) WriteFormJSON ¶ added in v1.0.330
func (f *FormField) WriteFormJSON(qq422016 qtio422016.Writer, blocks ...BlockColumns)
func (*FormField) WriteRenderForm ¶ added in v1.0.11512
func (f *FormField) WriteRenderForm(qq422016 qtio422016.Writer, isHTML bool, blocks ...BlockColumns)
type MarshalRow ¶
type PersonData ¶
type PersonData struct { Id int Login string Email string Sex int Rows []MarshalRow }
func (*PersonData) JSON ¶
func (d *PersonData) JSON() string
func (*PersonData) StreamJSON ¶
func (d *PersonData) StreamJSON(qw422016 *qt422016.Writer)
func (*PersonData) WriteJSON ¶
func (d *PersonData) WriteJSON(qq422016 qtio422016.Writer)
type SignForm ¶
type SignForm struct {
Email, Password string
}
func (*SignForm) SigninForm ¶
func (*SignForm) StreamSigninForm ¶
func (*SignForm) WriteSigninForm ¶
func (sf *SignForm) WriteSigninForm(qq422016 qtio422016.Writer)