Show the default values in 'NUMERIC BETWEEN' query form component as textbox watermarks¶
NOTE : This change refers to Sitools2 - v2.4
The default min and max values of 'NUMERIC BETWEEN' are shown by Sitools2 in black, and submitted as actual values to the SQL query.
In order to make them appearing as grey watermarks (i.e. as default text disappearing as soon as the cursor is active in the area), add the emptyText
property to the Ext.form.NumberField()
,
for fieldFrom
:
// *** Default min value is provided as hint, with 'emptyText' style ***
if(this.defaultValues[0]){
this.fieldFrom.emptyText="min: "+String(this.defaultValues[0]);
}
source:git_sitools_idoc|szcluster-db/workspace/client-public/js/forms/components/NumberBetween.js@b560664f#L87
and for fieldTo
:
// *** Default max value is provided as hint, with 'emptyText' style ***
if(this.defaultValues[1]){
this.fieldTo.emptyText="max: "+String(this.defaultValues[1]);
}
source:git_sitools_idoc|szcluster-db/workspace/client-public/js/forms/components/NumberBetween.js@b560664f#L108
The final result is the following: