Page 2 of 2

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Mon Jun 07, 2021 9:42 pm
by Marc Venken
Silvio.Falconi wrote:I make a test "all together" ( csortbox, search,multisel)


Sylvio, I wanted to make some test on this sample... Is it available ?

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Mon Jun 07, 2021 9:46 pm
by Silvio.Falconi
Perhaps I found the solution

WITH OBJECT oBrw
WITH OBJECT oBrw:aCols[ 1]
:cSortOrder:="CLICOGNOME"

END
WITH OBJECT oBrw:aCols[ 2]
:cSortOrder:="CLINOME"

END
WITH OBJECT oBrw:aCols[ 6]
:cSortOrder:="CLIPAESE"

END

but then I cannot click on headers

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Mon Jun 07, 2021 10:03 pm
by Silvio.Falconi
Marc Venken wrote:
Silvio.Falconi wrote:I make a test "all together" ( csortbox, search,multisel)


Sylvio, I wanted to make some test on this sample... Is it available ?


I create a unique test from

csortbox, search := xbsortcb.prg
multisel := xbmulsel.prg

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Mon Jun 07, 2021 11:44 pm
by nageswaragunupudi
Set cSortOrder of columns you do not want to sort as "".
Example:

oBrw:aCols[ 3 ]:cSortOrder := ""
oBrw:aCols[ 4 ]:cSortOrder := ""
.....

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Tue Jun 08, 2021 9:07 am
by Silvio.Falconi
nageswaragunupudi wrote:Set cSortOrder of columns you do not want to sort as "".
Example:

oBrw:aCols[ 3 ]:cSortOrder := ""
oBrw:aCols[ 4 ]:cSortOrder := ""
.....


Not run ok
on the combobox run ok then if I click on header 3,4 make the sort
test sample (your modified sample)
Code: Select all  Expand view

#include "FiveWin.ch"
#include "constant.ch"

 REQUEST DBFCDX


function TestTDatabase()

   local oDlg, oBrw, oDbf
   local cSeek:=Space(100)
   local oGet

   local aCols    := { ;
                { "FIRST"     , "Cognome",,        120},;
                { "LAST"      , "Nome"   ,,        120 },;
                { "STREET"    , "Indirizzo",,      120 },;
                { "CITY"      , "Località",,       120 },;
                { "STATE"     , "Provincia",,       40 },;
                { "ZIP"       , "Cap", ,            60 }}




   oDbf  := TDatabase():Open( nil, "Customer", "DBFCDX", .t. )
   oDbf:SetOrder( "FIRST" )
   oDbf:GoTop()

   DEFINE DIALOG oDlg SIZE 800,400 PIXEL TRUEPIXEL RESIZABLE

   @ 10, 165 GET oGet VAR cSeek SIZE 280,24 PIXEL OF oDlg

   @ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oDbf COLUMNS aCols ;
      AUTOSORT ;
      NOBORDER CELL LINES

        oBrw:aCols[ 3 ]:cSortOrder := ""   //no street
        oBrw:aCols[ 6 ]:cSortOrder := ""  // no zip

   WITH OBJECT oBrw


      :RecSelShowRecNo()
      :bClrStd          := { || { CLR_BLACK, If( oBrw:SelectRow(), 0x88EDFB, CLR_WHITE ) } }
      :nRecSelColor     :=   nRgb( 245,244,234)
      :lIncrFilter   := .t.
      :bOnSort       := { |b,oCol| oBrw:Seek( "" ), ;
                             oBrw:cFilterFld := oCol:cExpr, ;
                             oBrw:SetFocus() }
      //
       :SetMultiSelectCol()
       :oSeek := oGet
      :CreateFromCode()
   END



   @ 10, 20 COMBOBOX oBrw:oSortCbx VAR oBrw:cSortOrder  SIZE 100,400 PIXEL OF oDlg


   ACTIVATE DIALOG oDlg CENTERED

   oDbf:Close()

   return nil

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Wed Jun 09, 2021 10:31 am
by Silvio.Falconi
Marc Venken wrote:
Silvio.Falconi wrote:I make a test "all together" ( csortbox, search,multisel)


Sylvio, I wanted to make some test on this sample... Is it available ?


can use the last sample I publish before of this message

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Fri Jun 11, 2021 7:39 am
by Silvio.Falconi
Nages,
with this procedure I can see the logins of the users in the application.
As you told me to limit the index of some columns I put
cSorBox: = ""
Everything works except that when I press on the third column (time field) it doesn't index me but still displays the indexing arrow, while in the fourth column (process field) it doesn't index me but doesn't display the indexing arrow.

Image

the test

Code: Select all  Expand view


Function USR200()

 local cHelp
 local oDlgMon,oBar
 local oGrid
 local oDTab,nRec
 local aCols
 local cSeek:=Space(100)
 local oGet
 local oFont,oBold

 HelpSetTopic("Monitor del Sistema")


 oDTab:=TTabAct():New()
 nRec:=oDTab:Lastrec()
 oDTab:SetOrder(1)

  aCols  := { ;
                { "USUARIO"     , "Utente",,      120},;
                { "FECHA"       , "Data"   ,,     120 },;
                { "HORA"        , "Ora",,         120 },;
                { "ACCION"      , "Processo",,    200 }}

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD


   DEFINE DIALOG oDlgMon SIZE 880,600 ;
      PIXEL TRUEPIXEL RESIZABLE FONT oFont;
      TITLE "Monitor del Sistema"

   @ 10, 165 GET oGet VAR cSeek SIZE 280,24 PIXEL OF oDlgMon

         @ 40,20 XBROWSE oGrid SIZE -20,-20 PIXEL OF oDlgMon ;
      DATASOURCE oDTab COLUMNS aCols ;
      AUTOSORT ;
      NOBORDER CELL LINES

   
       WITH OBJECT oGrid
                :aCols[ 3 ]:cSortOrder := ""
                :aCols[ 4 ]:cSortOrder := ""
   
      :bClrStd          := { || { CLR_BLACK, If( oGrid:SelectRow(), 0x88EDFB, CLR_WHITE ) } }
      :nRecSelColor     :=   nRgb( 245,244,234)
      :lIncrFilter   := .t.
      :bOnSort       := { |b,oCol| oGrid:Seek( "" ), ;
                             oGrid:cFilterFld := oCol:cExpr, ;
                             oGrid:SetFocus() }
      //
      * :SetMultiSelectCol()
       :oSeek := oGet
      :CreateFromCode()
   END

     @ 10, 20 COMBOBOX oGrid:oSortCbx VAR oGrid:cSortOrder  SIZE 100,400 PIXEL OF oDlgMon


   ACTIVATE DIALOG oDlgMon CENTERED

  RETURN (NIL)

 



can you remove the indexing arrow in the third column?

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Sun Jun 13, 2021 10:16 pm
by nageswaragunupudi
Sorry, please try this:
Code: Select all  Expand view
      :aCols[ 3 ]:cSortOrder := nil
      :aCols[ 4 ]:cSortOrder := nil
 

Re: FWH 2103: XBrowse: oSortCbx

PostPosted: Mon Jun 14, 2021 7:00 am
by Silvio.Falconi
nageswaragunupudi wrote:Sorry, please try this:
Code: Select all  Expand view
      :aCols[ 3 ]:cSortOrder := nil
      :aCols[ 4 ]:cSortOrder := nil
 


run ok thanks