【问题标题】:How to set column 100% width on basic js|DataGrid on Apache Royale如何在 Apache Royale 上的基本 js|DataGrid 上设置列 100% 宽度
【发布时间】:2020-02-14 18:01:22
【问题描述】:

我在列宽问题上苦苦挣扎。我希望最后一列是 100% 宽度 显然我不能使用 columnWidth="100%"。

我在 SDK 0.9.6 中使用 js|DataGrid(基本)

这是我的代码:

<js:DataGrid localId="dg" percentWidth="100" percentHeight="100">
<js:columns>
    <js:DataGridColumn label="Date" dataField="FAC_DATE" columnWidth="120"/>
    <js:DataGridColumn label="Px. H.T." dataField="FAC_PX_HT" columnWidth="160"/>
    <js:DataGridColumn label="Label" dataField="FAC_DESIGNATION" />
</js:columns>

这是给出以下 JS :

<div id="dataGridColumn2" class="last DataGridColumnList" style="overflow: hidden;vertical-align: top;left: 280px;top: 0px;width: 66px;display: inline-block;">

问题是 width: 66px; 。我怎样才能摆脱这个? 我在样式中尝试了这个(在包含我的 DataGrid 的 mxml 中):

<fx:Style>
    @namespace j "library://ns.apache.org/royale/jewel";
    @namespace js "library://ns.apache.org/royale/basic";
    .last   {
        width: "max-content";
    }
</fx:Style>

也试试

    <js:DataGridColumn label="Label" dataField="FAC_DESIGNATION" className="mycolumnmax" />

.mycolumnmax   {
    width: "max-content";
}

但这不起作用,就像我的类名被忽略了。

请帮忙!

【问题讨论】:

    标签: datagrid column-width apache-royale


    【解决方案1】:

    在我看来,目前不支持此功能。 Royale 目前有 DataGridLayout 和 DataGridPercentageLayout,前者是默认的。当 DataGridLayout 看到未定义的列宽(在您的示例中为第 3 列)时,它只是假设宽度分布相等,即总网格宽度除以列数。

    我建议你在 GitHub 上打开一个问题并请求一个新的布局,或者参与其中并创建一个。

    为了加快速度,您可以随时咨询商业支持 [1]。

    [1]https://royale.apache.org/royale-commercial-support/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-12
      • 2022-01-22
      • 1970-01-01
      • 2020-03-29
      • 1970-01-01
      • 2022-01-20
      相关资源
      最近更新 更多