|
List Info
Thread: Bug in sorting capability to BBjStandardGrid
|
|
| Bug in sorting capability to
BBjStandardGrid |
  Germany |
2007-06-26 06:19:45 |
Hi,
this article is nice: http://
basis.com/advantage/mag-v9n2/grid.html
the only thing is that it doesn't show how to sort floating
point numbers.
When I tried sorting a column containing floating point
numbers I
discovered that they seem to be sorted correctly but for
some reason
they're hidden !! A bug?
Regards
Jan Györvari
---------->8-------------------------------->8--------
-----------
Sample code:
REM Set all columns user Sortable
REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()
REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"
REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()
REM Set addWindow param values
X=10
Y=10
WIDTH=300
HEIGHT=300
TITLE$="BBj Window - Sort"
REM Set the current context
mySysGui!.setContext(0)
REM Create a window
myWindow! =
mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$000002$)
REM Add a grid on the window
myGrid! = myWindow!.addGrid(101,25,25,250,200,$8060$,10,2)
REM Add button to the window
sortButton!=myWindow!.addButton(102,90,230,120,30,"Set
All Columns
Sortable",$$)
REM Set the grid properties
myGrid!.setDefaultColumnWidth(130)
myGrid!.setGridEditable(1)
myGrid!.setFitToGrid(1)
myGrid!.setRowHeight(16)
myGrid!.setEditable(1)
myGrid!.setHasColumnHeader(1)
REM set the first column sortable by clicking on the Header
myGrid!.setColumnUserSortable(0,1)
myGrid!.setColumnStyle(0, myGrid!.GRID_STYLE_INPUTN)
myGrid!.setColumnStyle(1, myGrid!.GRID_STYLE_INPUTN)
REM Add text to the grid cells
FOR ROW = 0 TO 9
FOR COL = 0 TO 1
if row=3 and col=0 then
CELLTEXT$=STR(ROW+1) + STR(COL+1)+".5"
else
CELLTEXT$=STR(ROW+1) + STR(COL+1)
fi
myGrid!.setCellText(ROW,COL,CELLTEXT$)
NEXT COL
NEXT ROW
REM Register the CALLBACK routines
myGrid!.setCallback(myGrid!.ON_GRID_EDIT_STOP,"CALL_RES
ORT")
myWindow!.setCallback(myWindow!.ON_CLOSE,"APP_CLOSE&quo
t;)
sortButton!.setCallback(sortButton!.ON_BUTTON_PUSH,"SET
_COLUMNS_SORTABLE")
REM Process Events
PROCESS_EVENTS
REM Callback routine called when the user closes the
application window
APP_CLOSE:
RELEASE
RETURN
CALL_RESORT:
PRINT "calling resort"
myGrid!.resort()
RETURN
SET_COLUMNS_SORTABLE:
IF sortButton!.getText() = "Set All Columns
Sortable" THEN
sortButton!.setText("Set All Columns non
sortable")
myGrid!.setAllColumnsUserSortable(1)
ELSE
sortButton!.setText("Set All Columns Sortable")
myGrid!.setAllColumnsUserSortable(0)
FI
RETURN
# Need help using (or leaving) this mailing list?
# Email majordomo basis.com with the command INFO
BBJ-DEVELOPER in the message body.
|
|
| Re: Bug in sorting capability to
BBjStandardGrid |

|
2007-06-26 06:50:01 |
|
Hi Jan,
since you use INPUTN - style cells, you need to set a Mask capable to
show the decimals. Eg:
myGrid!.setColumnMask(0, "000.0")
Sincerely,
Stephan Knobloch
KMK Software AG
Englerstraße 24, D-76275 Ettlingen
Tel: 07243/531-0
Fax: 07243/531-100
Vorstand: Stephan Knobloch
Aufsichtsratsvors.: Peter Knobloch
Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
Steuer-Nummer: 31193/31305
USt.-Identnummer: DE143598818
Jan Györvari schrieb:
milo.basis.com" type="cite">Hi,
this article is nice: http://basis.com/advantage/mag-v9n2/grid.html
the only thing is that it doesn't show how to sort floating point
numbers.
When I tried sorting a column containing floating point numbers I
discovered that they seem to be sorted correctly but for some reason
they're hidden !! A bug?
Regards
Jan Györvari
---------->8-------------------------------->8-------------------
Sample code:
REM Set all columns user Sortable
REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()
REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"
REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()
REM Set addWindow param values
X=10
Y=10
WIDTH=300
HEIGHT=300
TITLE$="BBj Window - Sort"
REM Set the current context
mySysGui!.setContext(0)
REM Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$000002$)
REM Add a grid on the window
myGrid! = myWindow!.addGrid(101,25,25,250,200,$8060$,10,2)
REM Add button to the window
sortButton!=myWindow!.addButton(102,90,230,120,30,"Set All Columns
Sortable",$$)
REM Set the grid properties
myGrid!.setDefaultColumnWidth(130)
myGrid!.setGridEditable(1)
myGrid!.setFitToGrid(1)
myGrid!.setRowHeight(16)
myGrid!.setEditable(1)
myGrid!.setHasColumnHeader(1)
REM set the first column sortable by clicking on the Header
myGrid!.setColumnUserSortable(0,1)
myGrid!.setColumnStyle(0, myGrid!.GRID_STYLE_INPUTN)
myGrid!.setColumnStyle(1, myGrid!.GRID_STYLE_INPUTN)
REM Add text to the grid cells
FOR ROW = 0 TO 9
FOR COL = 0 TO 1
if row=3 and col=0 then
CELLTEXT$=STR(ROW+1) + STR(COL+1)+".5"
else
CELLTEXT$=STR(ROW+1) + STR(COL+1)
fi
myGrid!.setCellText(ROW,COL,CELLTEXT$)
NEXT COL
NEXT ROW
REM Register the CALLBACK routines
myGrid!.setCallback(myGrid!.ON_GRID_EDIT_STOP,"CALL_RESORT")
myWindow!.setCallback(myWindow!.ON_CLOSE,"APP_CLOSE")
sortButton!.setCallback(sortButton!.ON_BUTTON_PUSH,"SET_COLUMNS_SORTABLE")
REM Process Events
PROCESS_EVENTS
REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN
CALL_RESORT:
PRINT "calling resort"
myGrid!.resort()
RETURN
SET_COLUMNS_SORTABLE:
IF sortButton!.getText() = "Set All Columns Sortable" THEN
sortButton!.setText("Set All Columns non sortable")
myGrid!.setAllColumnsUserSortable(1)
ELSE
sortButton!.setText("Set All Columns Sortable")
myGrid!.setAllColumnsUserSortable(0)
FI
RETURN
# Need help using (or leaving) this mailing list?
# Email basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the
message body.
|
| Re: Bug in sorting capability to
BBjStandardGrid |
  Germany |
2007-06-26 11:07:40 |
Thank you, Stephan, the missing mask was the problem!!
Do you know a way of getting the current selection status
(column that
the grid is sorted by and the order in which it's sorted) so
I don't
need to remeber it with every klick on the column header?
Jan Györvari
Stephan Knobloch schrieb:
> Hi Jan,
>
> since you use INPUTN - style cells, you need to set a
Mask capable to
> show the decimals. Eg:
>
> myGrid!.setColumnMask(0, "000.0")
>
>
>
> Sincerely,
>
> Stephan Knobloch
>
> KMK Software AG
> Englerstraße 24, D-76275 Ettlingen
>
> Tel: 07243/531-0
> Fax: 07243/531-100
>
>
> Vorstand: Stephan Knobloch
> Aufsichtsratsvors.: Peter Knobloch
> Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
> Steuer-Nummer: 31193/31305
> USt.-Identnummer: DE143598818
>
>
>
>
> Jan Györvari schrieb:
>> Hi,
>>
>> this article is nice: http://
basis.com/advantage/mag-v9n2/grid.html
>>
>> the only thing is that it doesn't show how to sort
floating point
>> numbers.
>>
>> When I tried sorting a column containing floating
point numbers I
>> discovered that they seem to be sorted correctly
but for some reason
>> they're hidden !! A bug?
>>
>> Regards
>> Jan Györvari
>>
>>
---------->8-------------------------------->8--------
-----------
>>
>> Sample code:
>>
>>
>> REM Set all columns user Sortable
>>
>> REM Obtain the instance of the BBjAPI object
>> LET myAPI!=BBjAPI()
>>
>> REM Open the SysGui device
>> SYSGUI=UNT
>> OPEN (SYSGUI) "X0"
>>
>> REM Obtain the instance of the BBjSysGui object
>> LET mySysGui!=myAPI!.getSysGui()
>>
>> REM Set addWindow param values
>> X=10
>> Y=10
>> WIDTH=300
>> HEIGHT=300
>> TITLE$="BBj Window - Sort"
>>
>> REM Set the current context
>> mySysGui!.setContext(0)
>>
>> REM Create a window
>> myWindow! =
mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$000002$)
>>
>> REM Add a grid on the window
>> myGrid! =
myWindow!.addGrid(101,25,25,250,200,$8060$,10,2)
>>
>> REM Add button to the window
>>
sortButton!=myWindow!.addButton(102,90,230,120,30,"Set
All Columns
>> Sortable",$$)
>>
>> REM Set the grid properties
>> myGrid!.setDefaultColumnWidth(130)
>> myGrid!.setGridEditable(1)
>> myGrid!.setFitToGrid(1)
>> myGrid!.setRowHeight(16)
>> myGrid!.setEditable(1)
>> myGrid!.setHasColumnHeader(1)
>>
>> REM set the first column sortable by clicking on
the Header
>> myGrid!.setColumnUserSortable(0,1)
>>
>> myGrid!.setColumnStyle(0,
myGrid!.GRID_STYLE_INPUTN)
>> myGrid!.setColumnStyle(1,
myGrid!.GRID_STYLE_INPUTN)
>>
>> REM Add text to the grid cells
>> FOR ROW = 0 TO 9
>> FOR COL = 0 TO 1
>> if row=3 and col=0 then
>> CELLTEXT$=STR(ROW+1) +
STR(COL+1)+".5"
>> else
>> CELLTEXT$=STR(ROW+1) + STR(COL+1)
>> fi
>> myGrid!.setCellText(ROW,COL,CELLTEXT$)
>> NEXT COL
>> NEXT ROW
>>
>> REM Register the CALLBACK routines
>>
myGrid!.setCallback(myGrid!.ON_GRID_EDIT_STOP,"CALL_RES
ORT")
>>
myWindow!.setCallback(myWindow!.ON_CLOSE,"APP_CLOSE&quo
t;)
>>
sortButton!.setCallback(sortButton!.ON_BUTTON_PUSH,"SET
_COLUMNS_SORTABLE")
>>
>>
>> REM Process Events
>> PROCESS_EVENTS
>>
>> REM Callback routine called when the user closes
the application window
>> APP_CLOSE:
>> RELEASE
>> RETURN
>>
>> CALL_RESORT:
>> PRINT "calling resort"
>> myGrid!.resort()
>> RETURN
>>
>> SET_COLUMNS_SORTABLE:
>> IF sortButton!.getText() = "Set All Columns
Sortable" THEN
>> sortButton!.setText("Set All Columns non
sortable")
>> myGrid!.setAllColumnsUserSortable(1)
>> ELSE
>> sortButton!.setText("Set All Columns
Sortable")
>> myGrid!.setAllColumnsUserSortable(0)
>> FI
>> RETURN
>>
>>
>> # Need help using (or leaving) this mailing list?
>> # Email majordomo basis.com with the command
INFO BBJ-DEVELOPER in the
>> message body.
>>
> # Need help using (or leaving) this mailing list? #
Email
> majordomo basis.com with the command INFO
BBJ-DEVELOPER in the message
> body.
# Need help using (or leaving) this mailing list?
# Email majordomo basis.com with the command INFO
BBJ-DEVELOPER in the message body.
|
|
| Re: Bug in sorting capability to
BBjStandardGrid |

|
2007-06-27 03:15:27 |
|
Hi Jan,
if you rely on the automatic sorting feature of the grids, then it is
currently not possible to retrieve if the grid was sorted by a user,
which column and possible sort order. This is QA 18842: Grid
enhancement: provide method BBjVector BBjGrid::getSortInfo().
You really need do this manually by tracking mouse clicks on grid
header and sort columns by program. But I agree, that this may not
possible for most developers to change all existing programs with
grids. We suffer from this too.
Sincerely,
Stephan Knobloch
KMK Software AG
Englerstraße 24, D-76275 Ettlingen
Tel: 07243/531-0
Fax: 07243/531-100
Vorstand: Stephan Knobloch
Aufsichtsratsvors.: Peter Knobloch
Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
Steuer-Nummer: 31193/31305
USt.-Identnummer: DE143598818
Jan Györvari schrieb:
milo.basis.com" type="cite">Thank
you, Stephan, the missing mask was the problem!!
Do you know a way of getting the current selection status (column that
the grid is sorted by and the order in which it's sorted) so I don't
need to remeber it with every klick on the column header?
Jan Györvari
Stephan Knobloch schrieb:
Hi Jan,
since you use INPUTN - style cells, you need to set a Mask capable to
show the decimals. Eg:
myGrid!.setColumnMask(0, "000.0")
Sincerely,
Stephan Knobloch KMK Software AG Englerstraße 24, D-76275 Ettlingen
Tel: 07243/531-0 Fax: 07243/531-100
Vorstand: Stephan Knobloch
Aufsichtsratsvors.: Peter Knobloch
Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
Steuer-Nummer: 31193/31305
USt.-Identnummer: DE143598818
Jan Györvari schrieb:
Hi,
this article is nice: http://basis.com/advantage/mag-v9n2/grid.html
the only thing is that it doesn't show how to sort floating point
numbers.
When I tried sorting a column containing floating point numbers I
discovered that they seem to be sorted correctly but for some reason
they're hidden !! A bug?
Regards
Jan Györvari
---------->8-------------------------------->8-------------------
Sample code:
REM Set all columns user Sortable
REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()
REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"
REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()
REM Set addWindow param values
X=10
Y=10
WIDTH=300
HEIGHT=300
TITLE$="BBj Window - Sort"
REM Set the current context
mySysGui!.setContext(0)
REM Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$000002$)
REM Add a grid on the window
myGrid! = myWindow!.addGrid(101,25,25,250,200,$8060$,10,2)
REM Add button to the window
sortButton!=myWindow!.addButton(102,90,230,120,30,"Set All Columns
Sortable",$$)
REM Set the grid properties
myGrid!.setDefaultColumnWidth(130)
myGrid!.setGridEditable(1)
myGrid!.setFitToGrid(1)
myGrid!.setRowHeight(16)
myGrid!.setEditable(1)
myGrid!.setHasColumnHeader(1)
REM set the first column sortable by clicking on the Header
myGrid!.setColumnUserSortable(0,1)
myGrid!.setColumnStyle(0, myGrid!.GRID_STYLE_INPUTN)
myGrid!.setColumnStyle(1, myGrid!.GRID_STYLE_INPUTN)
REM Add text to the grid cells
FOR ROW = 0 TO 9
FOR COL = 0 TO 1
if row=3 and col=0 then
CELLTEXT$=STR(ROW+1) + STR(COL+1)+".5"
else
CELLTEXT$=STR(ROW+1) + STR(COL+1)
fi
myGrid!.setCellText(ROW,COL,CELLTEXT$)
NEXT COL
NEXT ROW
REM Register the CALLBACK routines
myGrid!.setCallback(myGrid!.ON_GRID_EDIT_STOP,"CALL_RESORT")
myWindow!.setCallback(myWindow!.ON_CLOSE,"APP_CLOSE")
sortButton!.setCallback(sortButton!.ON_BUTTON_PUSH,"SET_COLUMNS_SORTABLE")
REM Process Events
PROCESS_EVENTS
REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN
CALL_RESORT:
PRINT "calling resort"
myGrid!.resort()
RETURN
SET_COLUMNS_SORTABLE:
IF sortButton!.getText() = "Set All Columns Sortable" THEN
sortButton!.setText("Set All Columns non sortable")
myGrid!.setAllColumnsUserSortable(1)
ELSE
sortButton!.setText("Set All Columns Sortable")
myGrid!.setAllColumnsUserSortable(0)
FI
RETURN
# Need help using (or leaving) this mailing list?
# Email basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the
message body.
# Need help using (or leaving) this mailing list? # Email
basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the message
body.
# Need help using (or leaving) this mailing list?
# Email basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the
message body.
|
| Re: Bug in sorting capability to
BBjStandardGrid |
  Germany |
2007-06-28 10:05:32 |
Hi Stephan,
tracking works for now. But what's going wrong when sorting
this grid
column containing datetime values?
grdTest!.setColumnStyle(0, grdTest!.GRID_STYLE_INPUTD)
grdTest!.setColumnMask(0, "%Dz.%Mz.%Yz")
All Cells contain a Date with the following format:
DD.MM.YY
Still, after sorting by column 1, the order is random!
Thanks in advance!
Jan Györvari
KLEBCHEMIE M. G. Becker GmbH + Co. KG
Max-Becker-Strasse 4
D-76356 Weingarten/Baden
tel +49 7244 62 161
fax +49 7244 700 161
Stephan Knobloch schrieb:
> Hi Jan,
>
> if you rely on the automatic sorting feature of the
grids, then it is
> currently not possible to retrieve if the grid was
sorted by a user,
> which column and possible sort order. This is QA 18842:
Grid
> enhancement: provide method BBjVector
BBjGrid::getSortInfo().
>
> You really need do this manually by tracking mouse
clicks on grid header
> and sort columns by program. But I agree, that this may
not possible for
> most developers to change all existing programs with
grids. We suffer
> from this too.
>
>
> Sincerely,
>
> Stephan Knobloch
>
> KMK Software AG
> Englerstraße 24, D-76275 Ettlingen
>
> Tel: 07243/531-0
> Fax: 07243/531-100
>
>
> Vorstand: Stephan Knobloch
> Aufsichtsratsvors.: Peter Knobloch
> Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
> Steuer-Nummer: 31193/31305
> USt.-Identnummer: DE143598818
>
>
> Jan Györvari schrieb:
>> Thank you, Stephan, the missing mask was the
problem!!
>>
>> Do you know a way of getting the current selection
status (column that
>> the grid is sorted by and the order in which it's
sorted) so I don't
>> need to remeber it with every klick on the column
header?
>>
>> Jan Györvari
>>
>>
>> Stephan Knobloch schrieb:
>>> Hi Jan,
>>>
>>> since you use INPUTN - style cells, you need to
set a Mask capable to
>>> show the decimals. Eg:
>>>
>>> myGrid!.setColumnMask(0, "000.0")
>>>
>>>
>>>
>>> Sincerely,
>>>
>>> Stephan Knobloch KMK Software AG Englerstraße
24, D-76275 Ettlingen
>>> Tel: 07243/531-0 Fax: 07243/531-100
>>>
>>> Vorstand: Stephan Knobloch
>>> Aufsichtsratsvors.: Peter Knobloch
>>> Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
>>> Steuer-Nummer: 31193/31305
>>> USt.-Identnummer: DE143598818
>>>
>>>
>>>
>>>
>>> Jan Györvari schrieb:
>>>> Hi,
>>>>
>>>> this article is nice: http://
basis.com/advantage/mag-v9n2/grid.html
>>>>
>>>> the only thing is that it doesn't show how
to sort floating point
>>>> numbers.
>>>>
>>>> When I tried sorting a column containing
floating point numbers I
>>>> discovered that they seem to be sorted
correctly but for some reason
>>>> they're hidden !! A bug?
>>>>
>>>> Regards
>>>> Jan Györvari
>>>>
>>>>
---------->8-------------------------------->8--------
-----------
>>>>
>>>> Sample code:
>>>>
>>>>
>>>> REM Set all columns user Sortable
>>>>
>>>> REM Obtain the instance of the BBjAPI
object
>>>> LET myAPI!=BBjAPI()
>>>>
>>>> REM Open the SysGui device
>>>> SYSGUI=UNT
>>>> OPEN (SYSGUI) "X0"
>>>>
>>>> REM Obtain the instance of the BBjSysGui
object
>>>> LET mySysGui!=myAPI!.getSysGui()
>>>>
>>>> REM Set addWindow param values
>>>> X=10
>>>> Y=10
>>>> WIDTH=300
>>>> HEIGHT=300
>>>> TITLE$="BBj Window - Sort"
>>>>
>>>> REM Set the current context
>>>> mySysGui!.setContext(0)
>>>>
>>>> REM Create a window
>>>> myWindow! =
mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$000002$)
>>>>
>>>> REM Add a grid on the window
>>>> myGrid! =
myWindow!.addGrid(101,25,25,250,200,$8060$,10,2)
>>>>
>>>> REM Add button to the window
>>>>
sortButton!=myWindow!.addButton(102,90,230,120,30,"Set
All Columns
>>>> Sortable",$$)
>>>>
>>>> REM Set the grid properties
>>>> myGrid!.setDefaultColumnWidth(130)
>>>> myGrid!.setGridEditable(1)
>>>> myGrid!.setFitToGrid(1)
>>>> myGrid!.setRowHeight(16)
>>>> myGrid!.setEditable(1)
>>>> myGrid!.setHasColumnHeader(1)
>>>>
>>>> REM set the first column sortable by
clicking on the Header
>>>> myGrid!.setColumnUserSortable(0,1)
>>>>
>>>> myGrid!.setColumnStyle(0,
myGrid!.GRID_STYLE_INPUTN)
>>>> myGrid!.setColumnStyle(1,
myGrid!.GRID_STYLE_INPUTN)
>>>>
>>>> REM Add text to the grid cells
>>>> FOR ROW = 0 TO 9
>>>> FOR COL = 0 TO 1
>>>> if row=3 and col=0 then
>>>> CELLTEXT$=STR(ROW+1) +
STR(COL+1)+".5"
>>>> else
>>>> CELLTEXT$=STR(ROW+1) + STR(COL+1)
>>>> fi
>>>> myGrid!.setCellText(ROW,COL,CELLTEXT$)
>>>> NEXT COL
>>>> NEXT ROW
>>>>
>>>> REM Register the CALLBACK routines
>>>>
myGrid!.setCallback(myGrid!.ON_GRID_EDIT_STOP,"CALL_RES
ORT")
>>>>
myWindow!.setCallback(myWindow!.ON_CLOSE,"APP_CLOSE&quo
t;)
>>>>
sortButton!.setCallback(sortButton!.ON_BUTTON_PUSH,"SET
_COLUMNS_SORTABLE")
>>>>
>>>>
>>>> REM Process Events
>>>> PROCESS_EVENTS
>>>>
>>>> REM Callback routine called when the user
closes the application window
>>>> APP_CLOSE:
>>>> RELEASE
>>>> RETURN
>>>>
>>>> CALL_RESORT:
>>>> PRINT "calling resort"
>>>> myGrid!.resort()
>>>> RETURN
>>>>
>>>> SET_COLUMNS_SORTABLE:
>>>> IF sortButton!.getText() = "Set All
Columns Sortable" THEN
>>>> sortButton!.setText("Set All Columns
non sortable")
>>>> myGrid!.setAllColumnsUserSortable(1)
>>>> ELSE
>>>> sortButton!.setText("Set All Columns
Sortable")
>>>> myGrid!.setAllColumnsUserSortable(0)
>>>> FI
>>>> RETURN
>>>>
>>>>
>>>> # Need help using (or leaving) this mailing
list?
>>>> # Email majordomo basis.com with the command
INFO BBJ-DEVELOPER in
>>>> the message body.
>>>>
>>> # Need help using (or leaving) this mailing
list? # Email
>>> majordomo basis.com with the command INFO
BBJ-DEVELOPER in the
>>> message body.
>>
>>
>> # Need help using (or leaving) this mailing list?
>> # Email majordomo basis.com with the command
INFO BBJ-DEVELOPER in the
>> message body.
>>
> # Need help using (or leaving) this mailing list? #
Email
> majordomo basis.com with the command INFO
BBJ-DEVELOPER in the message
> body.
# Need help using (or leaving) this mailing list?
# Email majordomo basis.com with the command INFO
BBJ-DEVELOPER in the message body.
|
|
| Re: Bug in sorting capability to
BBjStandardGrid |

|
2007-06-28 10:34:43 |
|
Hi Jan,
auto sorting in grids works by alphabet, but this is not useful for
dates (or numbers), which are human readable.
So you have 2 alternatives for dates:
1) Display the dates with another mask eg. YYYY-MM-DD.
2) store a date like that YYYY-MM-DD or simply the JUL() of the date in
setCellRelated(row, col, jul()) and the set the column as
setColumnSortedByRelatedData(int columnIndex,
boolean p_sortByRelated), so that BBj will
use the non visible related data to sort the grid.
For numbers you'll use cell related valued and ADJN() function, which
returns sortable values for numeric.
There may be some side effects or open qa memos with this, I currently
don't have spare time to recall all that. Just have a look at this...
Sincerely,
Stephan Knobloch
KMK Software AG
Englerstraße 24, D-76275 Ettlingen
Tel: 07243/531-0
Fax: 07243/531-100
Vorstand: Stephan Knobloch
Aufsichtsratsvors.: Peter Knobloch
Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
Steuer-Nummer: 31193/31305
USt.-Identnummer: DE143598818
Jan Györvari schrieb:
milo.basis.com" type="cite">Hi
Stephan,
tracking works for now. But what's going wrong when sorting this grid
column containing datetime values?
grdTest!.setColumnStyle(0, grdTest!.GRID_STYLE_INPUTD)
grdTest!.setColumnMask(0, "%Dz.%Mz.%Yz")
All Cells contain a Date with the following format: DD.MM.YY
Still, after sorting by column 1, the order is random!
Thanks in advance!
Jan Györvari
KLEBCHEMIE M. G. Becker GmbH + Co. KG
Max-Becker-Strasse 4
D-76356 Weingarten/Baden
tel +49 7244 62 161
fax +49 7244 700 161
Stephan Knobloch schrieb:
Hi Jan,
if you rely on the automatic sorting feature of the grids, then it is
currently not possible to retrieve if the grid was sorted by a user,
which column and possible sort order. This is QA 18842: Grid
enhancement: provide method BBjVector BBjGrid::getSortInfo().
You really need do this manually by tracking mouse clicks on grid
header and sort columns by program. But I agree, that this may not
possible for most developers to change all existing programs with
grids. We suffer from this too.
Sincerely,
Stephan Knobloch KMK Software AG Englerstraße 24, D-76275 Ettlingen
Tel: 07243/531-0 Fax: 07243/531-100
Vorstand: Stephan Knobloch
Aufsichtsratsvors.: Peter Knobloch
Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
Steuer-Nummer: 31193/31305
USt.-Identnummer: DE143598818
Jan Györvari schrieb:
Thank you, Stephan, the missing mask was
the problem!!
Do you know a way of getting the current selection status (column that
the grid is sorted by and the order in which it's sorted) so I don't
need to remeber it with every klick on the column header?
Jan Györvari
Stephan Knobloch schrieb:
Hi Jan,
since you use INPUTN - style cells, you need to set a Mask capable to
show the decimals. Eg:
myGrid!.setColumnMask(0, "000.0")
Sincerely,
Stephan Knobloch KMK Software AG Englerstraße 24, D-76275 Ettlingen
Tel: 07243/531-0 Fax: 07243/531-100
Vorstand: Stephan Knobloch
Aufsichtsratsvors.: Peter Knobloch
Amtsgericht Karlsruhe HRB 362754 (alt 2754 E)
Steuer-Nummer: 31193/31305
USt.-Identnummer: DE143598818
Jan Györvari schrieb:
Hi,
this article is nice: http://basis.com/advantage/mag-v9n2/grid.html
the only thing is that it doesn't show how to sort floating point
numbers.
When I tried sorting a column containing floating point numbers I
discovered that they seem to be sorted correctly but for some reason
they're hidden !! A bug?
Regards
Jan Györvari
---------->8-------------------------------->8-------------------
Sample code:
REM Set all columns user Sortable
REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()
REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"
REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()
REM Set addWindow param values
X=10
Y=10
WIDTH=300
HEIGHT=300
TITLE$="BBj Window - Sort"
REM Set the current context
mySysGui!.setContext(0)
REM Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$000002$)
REM Add a grid on the window
myGrid! = myWindow!.addGrid(101,25,25,250,200,$8060$,10,2)
REM Add button to the window
sortButton!=myWindow!.addButton(102,90,230,120,30,"Set All Columns
Sortable",$$)
REM Set the grid properties
myGrid!.setDefaultColumnWidth(130)
myGrid!.setGridEditable(1)
myGrid!.setFitToGrid(1)
myGrid!.setRowHeight(16)
myGrid!.setEditable(1)
myGrid!.setHasColumnHeader(1)
REM set the first column sortable by clicking on the Header
myGrid!.setColumnUserSortable(0,1)
myGrid!.setColumnStyle(0, myGrid!.GRID_STYLE_INPUTN)
myGrid!.setColumnStyle(1, myGrid!.GRID_STYLE_INPUTN)
REM Add text to the grid cells
FOR ROW = 0 TO 9
FOR COL = 0 TO 1
if row=3 and col=0 then
CELLTEXT$=STR(ROW+1) + STR(COL+1)+".5"
else
CELLTEXT$=STR(ROW+1) + STR(COL+1)
fi
myGrid!.setCellText(ROW,COL,CELLTEXT$)
NEXT COL
NEXT ROW
REM Register the CALLBACK routines
myGrid!.setCallback(myGrid!.ON_GRID_EDIT_STOP,"CALL_RESORT")
myWindow!.setCallback(myWindow!.ON_CLOSE,"APP_CLOSE")
sortButton!.setCallback(sortButton!.ON_BUTTON_PUSH,"SET_COLUMNS_SORTABLE")
REM Process Events
PROCESS_EVENTS
REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN
CALL_RESORT:
PRINT "calling resort"
myGrid!.resort()
RETURN
SET_COLUMNS_SORTABLE:
IF sortButton!.getText() = "Set All Columns Sortable" THEN
sortButton!.setText("Set All Columns non sortable")
myGrid!.setAllColumnsUserSortable(1)
ELSE
sortButton!.setText("Set All Columns Sortable")
myGrid!.setAllColumnsUserSortable(0)
FI
RETURN
# Need help using (or leaving) this mailing list?
# Email basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the
message body.
# Need help using (or leaving) this mailing list? # Email
basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the message
body.
# Need help using (or leaving) this mailing list?
# Email basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the
message body.
# Need help using (or leaving) this mailing list? # Email
basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the message
body.
# Need help using (or leaving) this mailing list?
# Email basis.com">majordomo basis.com with the command INFO BBJ-DEVELOPER in the
message body.
|
[1-6]
|
|