3.2.0

Couple of Bugs: column resize and onCurrentRowChanged

Greetings - been a long time user - (since early V1), just never posted before. Searched extensively for posted solutions to my issue and found nothing, so i am posting to show what i have identified.

Here is the code:
<SCRIPT LANGUAGE='JavaScript' SRC='/test/aw/runtime/lib/aw.js'></SCRIPT>
<link href="/test/aw/runtime/styles/xp/aw.css" rel="stylesheet" type="text/css" ></link>
<style>
  #grid_test .aw-column-0 {display: none!important;}
  #grid_test .aw-column-1 {width: 35px;}
  #grid_test .aw-column-2 {width: 35px;}
  #grid_test .aw-column-3 {width: 35px;}
  #grid_test .aw-column-4 {width: 35px;}
  #grid_test .aw-column-5 {display: none!important;}
  #grid_test .aw-grid-row .aw-column-1 {text-align: left; border-right: 1px solid threedlightshadow; margin-right: 0px;}
  #grid_test .aw-grid-row .aw-column-2 {text-align: left; border-right: 1px solid threedlightshadow; margin-right: 0px;}
  #grid_test .aw-grid-row .aw-column-3 {text-align: left; border-right: 1px solid threedlightshadow; margin-right: 0px;}
  #grid_test .aw-grid-row .aw-column-4 {text-align: left; border-right: 1px solid threedlightshadow; margin-right: 0px;}
</style>
<body>

<script>
    test_fun = function() {alert('hi');};	

    var obj = new AW.UI.Grid; 

    obj.setId("grid_test");
    obj.setCellData("cell"); 
    obj.setHeaderText("header"); 
    obj.setColumnCount(6); 
    obj.setRowCount(10); 

    obj.onCurrentRowChanged = test_fun;
    
    obj.setSelectionMode("multi-row");
   

    document.write(obj); 

</script>

</body>


Issue 1:
It appears that if there is a hidden column at the end, it causes the column-resize to fail on the last visible column. If you comment out the style line above for column 5 (the last column), then resize of the column begins working again.

Issue 2:
The onCurrentRowChanged method does not fire if you click/select the first row after loading. IF you click any other row it fires just fine. The selection mode is irrelevant, it won't fire under any of them.

You should be able to test the above code pretty easily on your own servers, or go to my test page at http://www.wasyliuk.com/test/test.cfm to see what i am referring to.

Thanks in advance for your help.
Ben W (ScheduleForce)
December 6,
Ben, you can avoid both with easy steps.

Issue 1:
Set the column-count to 5 to enable resizing on last column.
obj.setColumnCount(5);
You can also use setColumnIndices to hide desired columns ( instead of by css).
obj.setColumnCount(4);
obj.setColumnIndices([1,2,3,4]);
see: http://www.activewidgets.com/grid.howto.columns/hide.html

Issue 2:
Set the current row to '-1' before using the onCurrentRowChanged by:
obj.setCurrentRow(-1);

HTH
C++
December 7,
Thanks for the assistance.

These workarounds do indeed help with the problems described.

One note of warning (for anyone who may run into this) - using setCurrentRow(-1) will fire the onCurrentRowChanged event, so to not accidentally have that method executed before a user has actually selected a row, be sure to put the obj.setCurrentRow(-1); before the assignment of your function like so:
obj.setCurrentRow(-1);
obj.onCurrentRowChanged = test_fun;


thanks again.
Ben W (ScheduleForce)
December 7,

This topic is archived.

See also:


Back to support forum