Edu Posted February 16, 2017 Report Share Posted February 16, 2017 Boa tarde galera! Estou executando um filtro no xBrowse com array usando o metodo ArrayIncrFilter, porém não consigo limpar o filtro estabelecido quando a variável de pesquisa está vazia. Alguém teria uma dica para resolver ? Segue como estou fazendo: *********************************************************** * Get de pesquisa REDEFINE GET oGet2 VAR cSeek PICTURE "@!" ID 4002 OF oDlgPrd2 UPDATE ; VALID xBrFilter(oBr1, 3, cSeek, aProdAuto) * listagem oBr1:= TXBROWSE():NEW() oBr1:CreateFromResource(4008) oBr1:SetArray(aProdAuto,.T.) *********************************************************** FUNCTION xBrFilter(oBrw, nCol, cSeek, aArray) * Filtro no xbrowse com array de forma nativa. Filtra qualquer coluna no browse * Parametros: objeto, n. da coluna, variavel de pesquisa oBrw:lSeekWild := .T. DEFAULT nCol := 1 IF !Empty(cSeek) oBrw:cFilterFld:= nCol // seleciona a coluna que será ativado o filtro oBrw:ArrayIncrFilter(RTRIM(cSeek)) ELSE oBrw:aArrayData:= aArray oBrw:SetArray(aArray,.T.) ENDIF oBrw:Refresh() oBrw:Update() RETURN .T. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 16, 2017 Report Share Posted February 16, 2017 Única coisa que eu encontrei sobre isto: https://github.com/manuelcalerosolis/Gestool/blob/master/prg/Ixbrowse.prg Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 16, 2017 Report Share Posted February 16, 2017 Nenhum exemplo? METHOD ArrayIncrFilter( cSeek, nGoTo ) CLASS TXBrowse METHOD ArrayIncrSeek( cSeek, nGoTo ) CLASS TXBrowse Quote Link to comment Share on other sites More sharing options...
oribeiro Posted May 28, 2018 Report Share Posted May 28, 2018 Estou com o mesmo problema. Depois de ativado o filtro não consigo mais cancelá-lo e voltar a mostrar a matriz original no xBrowse. Não encontrei nenhum exemplo de uso dessa função: ArrayIncrFilter() Alguém descobriu como se fazer isso? Quote Link to comment Share on other sites More sharing options...
sistem Posted May 29, 2018 Report Share Posted May 29, 2018 tente assim cSeek := "" e oBrw:ArrayIncrFilter(RTRIM(cSeek)) deve limpar o filtro Quote Link to comment Share on other sites More sharing options...
oribeiro Posted May 29, 2018 Report Share Posted May 29, 2018 Obrigado pela dica. Eu tentei isso, mas não funcionou. Você tem outra sugestão? Quote Link to comment Share on other sites More sharing options...
sistem Posted May 29, 2018 Report Share Posted May 29, 2018 eu nao uso GET para pesquisa no xbrowse e sim o SAY como no exemplo abaixo... é com o oLbxPeFo:Seek( "" ) que zero o filtro... no seu caso é diferente @ 3, 116 COMBOBOX oPesqComboForn VAR nPesqComboForn ITEMS {"R.SOCIAL", "FANTASIA", "CÓDIGO", "CNPJ"} OF oDlgPeFo PIXEL COLOR CLR_GET1,CLR_GET2 SIZE 50,40 FONT oFont ON CHANGE MudaOrdemFornPesq(nPesqComboForn, oLbxPeFo) @ 4, 170 SAY oLbxPeFo:oSeek PROMPT oLbxPeFo:cSeek PICTURE "@!" UPDATE OF oDlgPeFo PIXEL COLOR CLR_BLACK FONT oFont1 SIZE 120, 10 BORDER *-------------------------------------------------------------------------------------- Function MudaOrdemFornPesq(nPesqComboForn, oLbxPeFo) oLbxPeFo:Seek( "" ) If nPesqComboForn = 1 Forn->(DbSetOrder("Forn2")) oLbxPeFo:cFilterFld := "Nom_Forn" ElseIf nPesqComboForn = 2 Forn->(DbSetOrder("Forn4")) oLbxPeFo:cFilterFld := "Fan_Forn" ElseIf nPesqComboForn = 3 Forn->(DbSetOrder("Forn1")) oLbxPeFo:cFilterFld := "Cod_Forn" Else Forn->(DbSetOrder("Forn3")) oLbxPeFo:cFilterFld := "Cgc_Forn" Endif oLbxPeFo:SetFocus() oLbxPeFo:Refresh() Return nil Quote Link to comment Share on other sites More sharing options...
oribeiro Posted May 31, 2018 Report Share Posted May 31, 2018 A rotina funcionando está aqui: http://forums.fivetechsupport.com/viewtopic.php?f=3&t=35692&p=212601#p212601 Obrigado a todos pelas boas sugestões. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.