Seaside/Smalltalk - how to highlight a row in a table? - smalltalk

Is there currently a way to highlight a row in a table? For example, I would like to list a table of entries and be able to highlight a row and click Process. I can't find any examples of this online - I'm sure there's a way though, right?
Highlighting the row could be done based on a radio button - a user selects the radio button for the row they want to update, and then click Process or whichever button they want, and that action would be performed for that row.
Any help on where I should look (or just a quick example) would be greatly appreciated!

If you're going to use a radio button, try add a jQuery action on it.
Something like:
onClick: ((html jQuery: #tableRowId) toggleClass: 'highlight')
Then have CSS that'll highlight the row
.hightlight {
background-color:light-yellow
}
If you need a more extensive example, let me know.

Related

Kendo-Vue Hide button in column?

i'm struggling with this one, i need to hide a button, i mean a command button based on the value of a column.
i grab the following example from kendo pages, i would like to show/hide the button "View Details" based on the "Discontinued" value.
i've already tested with :visible or :hide properties without success.
https://stackblitz.com/edit/e1fre3
does someone know how to get this working?
The command option is expecting string or array so this is an updated stackblitz example that worked at my side - https://stackblitz.com/edit/e1fre3-wnzfer?file=index.html

selenium ide : click button with class on specific row in table

I have an html table wich contain multiple lines.
At the end of each line, the last row contain multiple button. I would like to click on the remove button of the first line.
I tried this Xpath code but the element in not located :
There is a mistake somewhere in my xpath query :
//table[#id='tableTest']/tbody/tr[8]/td[8]/a[#class="remove"]
Your query looks pretty OK, but there is no HTML code so we can just guess what happen. What about the number 8?
Try to use XPath axes. For example locator could look like this:
//table[#id='tableTest']/tbody/tr[1]/descendant::a[#class="remove"]
This should find the remove button in the 1st row whenewer it is.
Click the button of the first line... which I think you mean first row?
//table[#id='tableTest']/tbody/tr//a[#class="remove"]
That SHOULD find the first tr (row) of your table and select the href with the class remove. But it's not going to ensure it's the last cell, which if that's vital you'll need to use something like //table[#id='tableTest']/tbody/tr/td[last()]/a[#class="remove"]
Also, if you attach the html snippet this becomes much easier for many of us to answer.

Gray out a form row's (detail's) button conditionally with VBA code

I have a standard form in MS-Access which lists a bunch of orders, and each row contains order no, customer, etc fields + a button to view notes and attached document files.
On request from our customer we should gray out the button btnAnm (or check or uncheck a checkbox) depending on a calculation from two queries to two other tables (a SELECT COUNT WHERE and a check if a text field is empty).
I've tried btnAnm_BeforeUpdate(...) and btnAnm_BeforeRender(...) and put breakpoints in the subs, but none of them trigger. The same if I use the control Ordernr instead of btnAnm.
I'd like a function in the Detail VBA code to be triggered for each "Me." (row) so to speak, and set the row's control's properties in that sub.
What do I do? I've looked at the help file and searched here.
*Edit: So I want to do something that "isn't made to work that way"? Ie. events are not triggered in Details.
As an alternative, could I base the value of a checkbox on each line on a query based on the 'Ordernr' field of the current row and the result of a SELECT COUNT from another table and empty field check?
Do I do this in the query the list is based on, or can I bind the extra checkbox field to a query?
A description of how to do this (combine a COUNT and a WHERE "not empty" to yes/no checkbox value) would be perfectly acceptable, I think! :)*
You cannot do much with an unbound control in a continuous form, anything you do will only apply to the current record. You can use a bound control with a click event so that it acts like a button.
Presumably the related documents have a reference to the order number that appears on your form, which means that you can create a control, let us call it CountOrders, with a ControlSource like so:
=DCount("OrderID","QueryName","OrderID=" & [OrderID])
The control can be hidden, or you can set it up to return true or False for use with a textbox, you can also use it for Conditional Formatting, but sadly, not for command buttons.
Expression Is [CountOrders]>0
You can also hide the contents and add a click event so that is acts in place of the command button. Conditional Formatting will allow you to enable or disable a textbox.
As I understand your question, you have a continuous form with as command button that appears on each row - and you'd like to enable/disable the button conditionally depending on the contents of the row.
Unfortunately you can't do that. It seems that you can't reference the individual command buttons separately.
Having wanted to do something similar in the past I came up with two alternate ways of setting up my interface.
Put a trap into the onClick code for the Button. Which is icky, because it is counter intuitive to the user. But it gets you that functionality now.
Move the command button (and editable fields) up into the form header, and make the rows read only. Your users then interact with the record only in the header, and select the record they want work with in the list below. As I recall this is known a Master-Detail interface.

Adding a datagrid inside another datagrid

I have a datagrid that uses a data structure like:
[
{
name: "test"
sub_things: [ { name: "blah" }]
}
]
Each row will have varying numbers of sub things and I an trying to add them as subrows in a row in the datagrid by adding another datagrid in the cell formatter, but cant seem to get it added. How would I acheive this? Or is there a better way?
What you are looking for exists! Check it out: subgrids!
Putting datagrids in datagrids, even if you can figure out how to do it sounds like a recipe for slowing down the browser or making it explode.
You could consider a few things:
Make this into a two step process. The first datagrid just has the name "test" and maybe a brief summary of sub_things. When you click on a row, it opens a new grid on another tab or maybe on the right side which contains the sub things just for that item.
You could use multi row layout of the datagrid like explained on this page (scroll down a bit for the multirow examples)
http://www.sitepen.com/blog/2008/07/14/dojo-12-grid/
You could have a combox box with a type ahead suggest of the main items and when one item is selected, then render a datagrid below it with the sub items.
By nesting grids in grids you are going to create a usability nightmare, so I would really recommend focusing on how to limit the data shown to the user and keep it as simple as possible.

Using grid events

Would anyone let me know how to refresh a grid depending on your selection from another grid. I'm looking at the example at
http://archive.dojotoolkit.org/nightly/checkout/dojox/data/demos/demo_QueryReadStore_grid.html
Is there is any way that the second grid can be updated once you click on any row in the first one. For example Assume that the first table has only the state names and the second one has the capitals. When I click on the State on the first table I only want to see the capital for that state at the second grid.
Please let me know if you have an answer for me.
Thanks,
I would do it this way, using refresh grid to change the store, and the layout of the other grid if necessary using the text value.
grid.onCellClick = function(e) {
refreshGrid(e.cellNode.innerHTML);
};