Google Appmaker selectedRow

大城市里の小女人 提交于 2019-12-08 05:18:59

问题


On a Google appmaker table, I have a label that I only want visible when the row is active/selected by the user.

I can see that the datasource.itemtIndex would give me the current index that my label is at (I presume it's not the selected index), but I can not seem to find a property that shows me the currently selected index/row.


回答1:


Bind the visibility of the label like this ==>

@widget.datasource.item._key === @datasources.<DatasourceName>.item._key

Just make sure to change <DatasourceName> with whatever datasource you're using.




回答2:


Try adding this style

visibleOnAncestorHover

to the label styles. This should make it visible both on hover and when selected. (This is used by default on Table widget's row delete buttons, I think.)

EDIT: and remember to have the 'visible' setting on for the label.




回答3:


The only way I found to do this is to set the visible binding on your label, of course you would want to set your visibility type to absent (will mis-align your table rows to labels) or hidden (will just hide the label). This solution is different from the 'visibleOnAncestorHover' as the label will still be hidden on other rows when you hover on those rows, it is only visible when the row is actually selected. The only binding that seems to work is this:

@datasources.YourDatasource.itemIndex === @widget.parent.childIndex

The following apparently does NOT work:

@datasource.itemIndex === @widget.parent.childIndex

or

@widget.datasource.itemIndex === @widget.parent.childIndex

Please see the picture below:




回答4:


You can specify this in the style editor:

.app-NewPage-Table1Row:not(.selected) .app-NewPage-Field2 {
    visibility: hidden;
}


来源:https://stackoverflow.com/questions/45830273/google-appmaker-selectedrow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!