Jump to content
Fivewin Brasil

XBROWSE AUTOSORT


oribeiro

Recommended Posts

Pessoal,

Como faço para que, quando o usuário clicar na coluna de um browse (criado com xBrowse), ele automaticamente reclassifique a planilha pela coluna?

Estou criando assim:

********************************************************************************************
Static function detal_Res(cDbf_p,cPro,wTit)
********************************************************************************************
   Select(cDbf_p)
   DbGoTop()
   If wTit = "PD"
      cTit := "RESUMO DOS PEDIDOS PENDENTES DO PRODUTO: "+Alltrim(cPro)
   Elseif wTit = "CP"
      cTit := "RESUMO DOS PEDIDOS DE COMPRA PENDENTES DO PRODUTO: "+Alltrim(cPro)
   Else
      cTit := "RESUMO DAS ORDENS DE MANUFATURA PENDENTES DO PRODUTO: "+Alltrim(cPro)
   Endif
   DEFINE DIALOG oDlg SIZE 800,420 FONT WndMain():oFont TITLE cTit TRANSPARENT
      @ 10,10 XBROWSE oBrw OF oDlg SIZE 380,180 PIXEL;
              ALIAS (cDbf_p);
              AUTOSORT AUTOCOLS FOOTERS LINES CELL
      oBrw:DT_EMISS:cEditPicture := 'dd/mm/yyyy'
      oBrw:DT_PREV:cEditPicture  := 'dd/mm/yyyy'
      oBrw:DelCol( 1 ) // Deleta Coluna
      AEval( oBrw:aCols, { |o| o:cToolTip := { 'Column :' + CRLF + o:cHeader, 'ToolTip' } } )     // ToolTip nas colunas
      oBrw:bClrStd := {|| {CLR_BLACK, iif(oBrw:Keyno()%2=0, CLR_WHITE, CLR_HGRAY) } }             // Cores nas linhas (Par/Impar) ou (oBrw:cAlias)->(RecN())%2=0
      oBrw:CreateFromCode()
      @ 195, 010 BUTTON "&Imprimir" SIZE 50,10 FONT oFontGet PIXEL ACTION IIF( MsgYesNo("Deseja imprimir essa planilha?","Confirme"), Listar(cTit,,,,,,,,,,,,,.F.), )
      @ 195, 070 BUTTON "&Excel"    SIZE 50,10 FONT oFontGet PIXEL ACTION oBrw:ToExcel()
      @ 195, 130 BUTTON "&Fechar"   SIZE 50,10 FONT oFontGet PIXEL ACTION oDlg:End()
   ACTIVATE DIALOG oDlg CENTERED;
      ON INIT oBrw:SetFocus()
Return(.T.)

Aguardo, obrigado.

Link to comment
Share on other sites

Ao clicar no header de cada coluna, organiza de acordo com o índice.


Exemplo:


oBrw:aCols[1]:bLClickHeader := {|| cDbf->(DBSETORDER(1)), oBrw:GoTop(), oBrw:Refresh()}

oBrw:aCols[2]:bLClickHeader := {|| cDbf->(DBSETORDER(2)), oBrw:GoTop(), oBrw:Refresh()}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...