mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Update the backform control to support sql-fields.
Following are the enhancements:
1. Added border to control which was missing earlier.
2. Allows user to provide height to sql-field control by specifying extraClasses field in model schema.
3. Defined new classes for sql-field control height in overrides.css
4. Added scrollbar to the control.
Usage:
{
id: 'definition', label:'{{ _("Definition") }}', cell: 'string',
type: 'text', mode: ['create', 'edit'], group: 'Definition',
control: Backform.SqlFieldControl, extraClasses:['custom_height_css_class']
}
This commit is contained in:
committed by
Dave Page
parent
b3c625f135
commit
03349f4af6
@@ -1754,12 +1754,27 @@
|
||||
|
||||
defaults: {
|
||||
label: "",
|
||||
extraClasses: [],
|
||||
extraClasses: ['sql_field_height_300'], // Add default control height
|
||||
helpMessage: null,
|
||||
maxlength: 4096,
|
||||
rows: undefined
|
||||
},
|
||||
|
||||
// Customize template to add new styles
|
||||
template: _.template([
|
||||
'<label class="<%=Backform.controlLabelClassName%>"><%=label%></label>',
|
||||
'<div class="<%=Backform.controlsClassName%> sql_field_layout <%=extraClasses.join(\' \')%>">',
|
||||
' <textarea ',
|
||||
' class="<%=Backform.controlClassName%> " name="<%=name%>"',
|
||||
' maxlength="<%=maxlength%>" placeholder="<%-placeholder%>" <%=disabled ? "disabled" : ""%>',
|
||||
' rows=<%=rows%>',
|
||||
' <%=required ? "required" : ""%>><%-value%></textarea>',
|
||||
' <% if (helpMessage && helpMessage.length) { %>',
|
||||
' <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
|
||||
' <% } %>',
|
||||
'</div>'
|
||||
].join("\n")),
|
||||
|
||||
/*
|
||||
* Initialize the SQL Field control properly
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user