Facility Control

 View Only
  • 1.  Param Table - Column Alignment

    Posted 08-31-2018 18:36
    Hey All:

    Wondering if anyone has found a way to set the alignment of text in the columns of a table created via param. I have 2 columns of text (name and ID) and would like the name column to be left justified and the ID column to be centered.

    Thanks!

    CJ


  • 2.  RE: Param Table - Column Alignment

    Posted 08-31-2018 18:53
    Are these editable fields or read-only?
    #DashBoard


  • 3.  RE: Param Table - Column Alignment

    Posted 08-31-2018 18:54
    Read only.
    #DashBoard


  • 4.  RE: Param Table - Column Alignment

    Posted 08-31-2018 19:01

    For read-only, it is easy to append style information to the end of your value for each row:

    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" constrainttype="STRING_CHOICE" name="Table" oid="params.table" precision="0" type="INT16" value="-1" widget="table">
                <constraint>col1</constraint>
                <constraint>col2</constraint>
             </param>
             <param access="1" maxlength="0" name="Col 1" oid="col1" precision="0" type="STRING_ARRAY" widget="label">
                <value>Value One&lt;style:col1style&gt;</value>
                <value>Value Two&lt;style:col1style&gt;</value>
                <value>Value Three&lt;style:col1style&gt;</value>
                <value>Value Four&lt;style:col1style&gt;</value>
                <value>Value Five&lt;style:col1style&gt;</value>
             </param>
             <param access="1" maxlength="0" name="Col 2" oid="col2" precision="0" type="STRING_ARRAY" widget="label">
                <value>Another Value One&lt;style:col2style&gt;</value>
                <value>Another Value Two&lt;style:col2style&gt;</value>
                <value>Another Value Three&lt;style:col2style&gt;</value>
                <value>Another Value Four&lt;style:col2style&gt;</value>
                <value>Another Value Five&lt;style:col2style&gt;</value>
             </param>
          </params>
          <style id="col1style" value="txt-align:west;"/>
          <style id="col2style" value="txt-align:center;"/>
       </meta>
       <param expand="true" height="250" left="15" oid="params.table" showlabel="false" top="18" width="341"/>
    </abs>

    If you want to do read/write, you would be best-served by switching to a 'script table' where you can specify different styles for each cell independent of the value.


    #DashBoard


  • 5.  RE: Param Table - Column Alignment

    Posted 08-31-2018 19:21

    Thanks James...I buried the lead quite a bit on the nature of my table. It's pulling data from a STRUCT:

    <param access="1" constrainttype="STRUCT" name="My Struct Definition" oid="mystruct_def" structtype="mystruct_def" type="STRUCT" widget="table">
    <value>
    <subparam access="0" maxlength="-1" name="NAME" suboid="mystruct_name" type="STRING" value=" " widget="default"/>
    <subparam access="1" constrainttype="INT_NULL" name="ID" precision="0" suboid="mystruct_id" type="INT16" value="0" widget="default"/>
    </value>
    </param>

    Is it still possible to set the text alignment in this case?


    #DashBoard


  • 6.  RE: Param Table - Column Alignment

    Posted 08-31-2018 19:39
    Same deal. As long as the String value of the parameter looks like "TEXT TO DISPLAY ", you can add any style information you want to a cell.
    #DashBoard


  • 7.  RE: Param Table - Column Alignment

    Posted 08-31-2018 19:47
    Cool! I'll play with it. Thanks!

    CJ
    #DashBoard