Codejock Grid with ProgressBar: Difference between revisions

m
add syntax highlighting
(Created page with "=== Author and origin === This example code was written by Peter Bragg and comes from the following post at the forum: https://support.dataaccess.com/Forums/showthread.php?6269...")
 
m (add syntax highlighting)
Line 11: Line 11:
First, we have the following mixin class (with included use statements and defines etc):
First, we have the following mixin class (with included use statements and defines etc):


 
<source lang="dataflex">
   Define clHexOffice_Turquoise    for '#1abc9c'  //Turquoise
   Define clHexOffice_Turquoise    for '#1abc9c'  //Turquoise
   Define clHexOffice_DrkTurquoise for '#16a085'  //GreenSea
   Define clHexOffice_DrkTurquoise for '#16a085'  //GreenSea
Line 119: Line 119:
     End_Function     
     End_Function     
   End_Class
   End_Class
</source>


We then incorporate that into a subclass of the cDbCJGridColumn class as follows:
We then incorporate that into a subclass of the cDbCJGridColumn class as follows:


<source lang="dataflex">
   Class cDemoDbCJGridColumn is a cDbCJGridColumn
   Class cDemoDbCJGridColumn is a cDbCJGridColumn
     Import_Class_Protocol mixin_cCJGridProgressBar
     Import_Class_Protocol mixin_cCJGridProgressBar
Line 151: Line 153:
     End_Procedure   
     End_Procedure   
   End_Class
   End_Class
</source>


And then you can use this, just as in the Order Entry view, as follows:
And then you can use this, just as in the Order Entry view, as follows:
Line 157: Line 160:




<source lang="dataflex">
   Object oProgressBar is a cDemoDbCJGridColumn
   Object oProgressBar is a cDemoDbCJGridColumn
     Set piWidth to 213
     Set piWidth to 213
Line 170: Line 174:
     End_Procedure     
     End_Procedure     
   End_Object
   End_Object
</source>


You can set the label to anything you want - here (above) I've simply set it to show the percentage value, so that you can see it is dynamic. You just have to make sure that it is encoded correctly.  
You can set the label to anything you want - here (above) I've simply set it to show the percentage value, so that you can see it is dynamic. You just have to make sure that it is encoded correctly.  
Line 177: Line 182:
Ok, so same mixin class as before, but this time we use it in a cCjGridColumn (not a cDbCjGridColumn)
Ok, so same mixin class as before, but this time we use it in a cCjGridColumn (not a cDbCjGridColumn)


<source lang="dataflex">
   Class cDemoCJGridColumn is a cCJGridColumn
   Class cDemoCJGridColumn is a cCJGridColumn
     Import_Class_Protocol mixin_cCJGridProgressBar
     Import_Class_Protocol mixin_cCJGridProgressBar
Line 196: Line 202:
     End_Procedure  
     End_Procedure  
   End_Class
   End_Class
 
</source>


And then we can use this inside an example view. Here I've taken the example for a cCjGrid (from the help) but I've added an additional column to show a progress bar
And then we can use this inside an example view. Here I've taken the example for a cCjGrid (from the help) but I've added an additional column to show a progress bar


<source lang="dataflex">
     Object oCustomerGrid is a cCJGrid
     Object oCustomerGrid is a cCJGrid
         Set Size to 200 300
         Set Size to 200 300
Line 276: Line 283:
             Send MovetoFirstRow
             Send MovetoFirstRow
         End_Procedure
         End_Procedure
</source>