uniDBGrid: Dynaimc Attributes
You can define ATTRIBUTES and/or MASKS for the fields that will be displayed in the GRID without adding a line of code and without adding the fields in the FIELDS EDITOR of the respective query.
Example without frmBaseCRUD inheritance
See frmFISHFACT to apply the necessary functions:
- OnDrawColumnCell event of "dbgFish" component
- UniFrameCreate event
- UniFrameReady event
Example inherited from frmBaseCRUD
Define your attributes in your uniDBGRID's HINT property or even in your form's OnCreate event as in the example below extracted from "frmCadCLIENTES":
dbgSearchCRUD.Hint := '[[' +
'fieldmasks:' +
//'no-paged|' +
//'grid-noforcefit|' +
'grid-forcefit:10 mobile-v-5 mobile-h-8|' + // v. 4.0.0.0
'model-crud:1|' +
'grid-resize|' +
'firstshow:0|'+ // v. 3.2.0.2
'grid-paginator:center|' + // v. 4.0.0.0
'código[[' +
//' locked|' +
' title:translate(codigo)|' +
' titlealign:c|' +
' align:c|' +
' width:135 mobile:90]];' +
// v. 4.0.0.0
// [PT]
// alguns campos com strings muito grandes são interpretados pelo unigui como MEMO e não
// sao exibidos, este atributo força a exibição do texto
// [EN]
// some fields with very large strings are interpreted by unigui as MEMO and not
// are displayed, this attribute forces the text to be displayed
//'memotest[[' +
//' displaymemo|]];' +
'nome[[' +
' title:translate(nome)]];' +
'email[[' +
' visible:false mobile]];' +
'endereco[[' +
' visible:false mobile]];' +
'numero[[' +
' visible:false mobile|' +
' align:r]];' +
'complemento[[' +
' visible:false]];' +
'cidade[[' +
' visible:false mobile]];' +
'uf[[' +
' visible:false mobile]];' +
'fone1[[' +
' visible:false mobile]];' +
'cnpj_cpf[[' +
' visible:false mobile]];' +
// v. 4.0.0.0
'dtcadastro[[' +
' visible:false]];' +
'dtaniversario[[' +
' visible:false]];' +
'cep[['+
' visible:false mobile|' +
' align:c|'+
' mask:' + mm.varC_Mask_cep + ']];' +
'valor_contrato[[' +
' visible:false mobile|' +
' cls:{<130,color-red,color-black}|'+
' mask:' + PFmtSettings.CurrencyString + ' ' + mm.varC_Mask_float + ']]; ' +
'limitecredito[[' +
' visible:false mobile|' +
' cls:color-blue]];' +
']]';
Created with the Personal Edition of HelpNDoc: Qt Help documentation made easy