Documentation ¶
Overview ¶
генерация форм на основе типов полей таблиц БД
Index ¶
- Constants
- func AnotherSignUpForm(placeholder string) string
- func ConvertType(t string) string
- func FormJSON(title, action, method string, columns []dbEngine.Column) 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 StreamConvertType(qw422016 *qt422016.Writer, t string)
- func StreamFormJSON(qw422016 *qt422016.Writer, title, action, method 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 WriteConvertType(qq422016 qtio422016.Writer, t string)
- func WriteFormJSON(qq422016 qtio422016.Writer, title, action, method string, ...)
- func WriteRenderCheckBox(qq422016 qtio422016.Writer, key, val, title string, idx int, ...)
- func WriteSignUpForm(qq422016 qtio422016.Writer, placeholder string)
- type AnotherMarshalRow
- type AnotherPersonData
- 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 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 ConvertType ¶ added in v1.0.297
func GetLengthFromType ¶
минимальный размер поля для разных типов полей
func RenderCheckBox ¶
func SignUpForm ¶
func StreamAnotherSignUpForm ¶
func StreamConvertType ¶ added in v1.0.297
func StreamFormJSON ¶ added in v1.0.297
func StreamRenderCheckBox ¶
func StreamSignUpForm ¶
func StyleInput ¶
старый метод, обсолете, буду избавляться TODO старый метод, обсолете, буду избавляться
func WriteAnotherSignUpForm ¶
func WriteAnotherSignUpForm(qq422016 qtio422016.Writer, placeholder string)
func WriteConvertType ¶ added in v1.0.297
func WriteConvertType(qq422016 qtio422016.Writer, t string)
func WriteFormJSON ¶ added in v1.0.297
func WriteFormJSON(qq422016 qtio422016.Writer, title, action, method string, columns []dbEngine.Column)
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 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 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)