Animate Table Rows in Table Updated via HTMX - css

I have a table that is updated via polling with HTMX, where each table row has a unique id. When a new row is deleted into the table or and existing row is updated, I want to animate this via CSS: deleted rows should fade away (obacity to 0) and new/updated rows should have a different background color for a time.
I tried the following:
Give each the unique id attribute
set hx-ext="morph" and hx-swap="morph:outerHTML swap:1s"
Try to add some css as suggested in the documentation
However this does not work as intended because the htmx-swapping class is applied
to the outer most element only and not on the elements with a new id only.
What would be the usual approach here without marking new table rows in the response directly?

Related

How to go down this table row wise and access selected attributes using Beautifulsoup?

Using webscraping, I am reading data from a table row wise. The html structure is shown below. Each row has a few columns (the highlighted ones) out of which I need to extract data. I have selected rows using:
for i in soup.find_all('tr',{'class':'resultRow'}):
so each item (i) in list is showing a whole row. Now I want to access information inside highlighted tags. If I do print(i.td), it prints only the next td tag. How can I access tags inside and their attributes?
It would be pretty much the same as you did to find rows.
for col in i.find_all('td'):
if 'class' in td:
print(td['class'])
if 'ng-repeat' in td:
print(td['ng-repeat'])

Track a particular row of a table of webclient page which has no unique id and this table keeps populating datas concurrently

I'm working with web client-GUI-automation testing tool development using selenium-x path-css.
With this webclient, it has a panel area at the lower panel.
Within this panel is a table which has no unique id for its row.
Scenario: When I add a VM through webclient-GUI, on clicking finish button, this lower panel area's table list at its first row that the task has started with
td: taskname, date, target in its row[1] of a table.
In this case if a single task is happening, then this table would have only one row.
So that i can check as
tr[1]td[1] = "Create_Vm" and confirm that the task has started.
But if multiple VM's say:3(vm1,vm2, vm3) are created concurrently, then the table would have
tr[1]td[1]
tr[2]td[1]
tr[3]td[1]
All to be create_vm.
My problem is how do I track a particular task say:vm2 using selenium-xpath-css as there is no unique id for table rowid?
If let's say VM name is in the first column and your desired webelement is in the second column. You can do something like this.
//*[contains(text(),'vm2')]../../td[2]
Find out your column using contains text and then go to it's parent node. And then to your desired column.
if the items are displayed in the order they are started, then do this:
//table//tr[x+1]/td[1]
if in reverse then:
//table//tr[position()=last()+1-x]/td[1]
where x is the vm number.

how to get and set the number of row in a tableView in javfx

I tried to manipulate a tableview and I need to know how to get the number of row that I have in a table view?
And how to set them?
The number of rows in the table is just
table.getItems().size()
You can't set this directly, of course, you just change it by adding and removing data from the table.

Changing the tooltip dynamically for each record

In forms I have a block that contains name of tables.
The column is narrow so I want to add a tooltip that contains the value for each row.
I tried to put this code in post_query
:set_item_property('block1.value',tooltip_text, :block1.value);
but the tooltip always contains the last row's value and shows
it for all the rows. What could be the problem here?
set_item_instance_property is the ideal way to affect a column for just specific rows of data. But, tooltip_text is not available for setting via set_item_instance_property.
What you could do, though, is put your call to set_item_property into a when-new-record-instance trigger on the block. That way it should change the tooltip each time a new record becomes the focus.

Flex Datagrid insert row below current row

my application needs to allow users to insert rows below the current datagrid row. My solution is to to add a row to the dataproviders collection. This works, but the row does not appear beneath the current row the user clicked on.
The Datagrid has a default sort order (date ASC), which re-orders the data...so this seems to affect the position of the row in the grid.
Any ideas how to fix this?
Two possible answers:
1. define your own sort function that sorts according to item order in dataprovider (i.e. it does nothing), and assign it to the sortFunction property
2. simply comment out the sorting of the data inside the component.

Resources