TableSorter filter - remove all rows with a given keyword - tablesorter

I am displaying a table with tablesorter that has column filtering and would like to add a button that would remove all rows in which the word "error" appears in a certain column. I managed to create a button that would essentially just throw
!error
to the filter but I would prefer that it leaves the filter field open so that one can still use it and retain the removal of the error rows.
I tried the method from TableSorter - External Search, Trying to search from button to filter all, not just column but while it can find all the columns with "error", putting "!error" doesn't work since even a row that contains "error" also has columns that don't contain it. Anyone know of a way to hide those rows while still retaining the filtering ability on the remaining rows?

A not (!) query applied to all columns was previously ignored; but tablesorter v2.26.2 was just released and it now allows those type of search queries.
Try this demo - click on the !aaron button to test it.

Related

Combining two columns & doing this for any future rows

I'm trying to create a formula to combine two columns but also automatically do this for subsequent items added to the list automatically. The answers are responses from a Google Form and when the form is submitted I would like the next item of the list to automatically combine the columns without needing to drag down the formula.
=CONCATENATE(I2:I," ",J2:J)
I've found a few solutions that list the items individually but want the two columns combined and then to continue for each subsequent item.
Try this formula, or see Example Sheet
=ArrayFormula(IF(I2:I="",,I2:I&" "&J2:J))
use:
=ARRAYFORMULA(I2:I&" "&J2:J)
or if you mind empty space in empty cell use:
=ARRAYFORMULA(TRIM(I2:I&" "&J2:J))

Vaadin grid user column re-ordering and saving per user

How do people tend to let users re-order the grid columns and save that ordering for later?
The only way I can think of to do it, at least in Vaadin 7, is:
Listen for column re-ordering via addColumnReorderListener(…)
When re-order triggered, if user initiated, get columns from getColumns() and save to DB with any identifying information
When pull Grid back up, read grid ordering from DB and apply the same order with setColumnOrder(columns)
So is there a better way to do this? I just checked the Directory, could not find anything obvious to make this easier. Just looking for how others have addressed this user requirement. If Vaadin 14 already supports such actions a little easier, that would be good to know as well, as it might give me some ideas on how to get that ability short term before I can upgrade to Vaadin 14.
For a more customizable grid you can (in addition to what you've already done) add a button that opens a dialog that lists all possible columnnames, together with a checkbox.
Unchecking the checkbox removes the column, checking the checkbox adds the column.
Even more comfortable is when the dialog lists all available columns in a Grid with draggable rows and editable checkboxes, so that the user can show, hide and sort all columns in one place. After that you have to reorder all columns by calling grid.setColumnOrder.
Just so people know how I solved this issue, based on the comments:
When load data into Grid, first check database for columns of this Grid/user combination. If find such a column order, call setColumnOrder(userColumns).
Added 2 buttons to top, one to save column order, one to reset it.
"Save" button only enabled after moving at least one column.
"Reset" button only enabled if at least one column was moved. One column was moved either because of the DB, or because user JUST moved a column.
On save, save to DB. On reset, clear from DB, and reset Grid to original column order.
We chose not to save the column order each time they changed the order, directly in the addColumnReorderListener, because we realized sometimes users might move columns around temporarily, and one really want to save that column order for the future. That said, the saving inside the addColumnReorderListener worked well.
We don't currently need to save the column sizes, as suggested by #Simon Martinelli, but we are keeping it as an idea for the future. I fully expect it would work.

Modify the auto-complete behavior in cell dropdown

I'm building a searching sheet, which take a dropdown cell as input data. User can select from the list, or type in the key word. Searched data will be populated by rows/column with my query formula. The search result itself works just fine.
However, the drop down list doesn't.
Here's a picture of my search.
As you can see in the picture, autocomplete would only populate 6 items, while my search query produce much more, which is exactly what I need. It's clear enough : Autocomplete compare the whole text, not word - by - word.
Is there anyway to change this behavior ?
My sheet is for other people to look for a specific item. I cannot expect them to know what I have entered in my database and force them to search by those exact keywords.
Anything from script to formula is fine with me. I just need at least, a lead..

How to get the all the recyclerView Items into ArrayList using appium

I have a scenario to verify the Sort&Filter functionality for Mobile App in Android.
Scenario:
Search for Item
Search Result Apper
Sort&Filter with some criteria
Have to Verify that Sort&Filter is applied correctly
Here results are added to RecyclerView.
As per RecyclerView/appium functionality, all the items are not loaded into view. Only visible Items are loaded into the view Hierarchy.
When I scroll Up the Linear Layout Indexes are re-arranged. I could not able to get all the Items.
Could you kindly provide me any sample scenario of this kind?
Or How can we achieve this kind of scenarios in Real Automation while working on the project?
Regards,
Shiva Oleti
Issue with Android as You stated is that it "sees" only what is visible on screen. I have similar issue, so I had to go deeper into element and fetch text. In your case I would do following:
1. Search Result Appear:
- fetch all visible elements, input search, fetch again -n results containing search result. Eg. if input 'beer' there should be eg. 4 elements with text containing "beer". Put elements in list and iterate:
List <MobileElement> listElements = driver.findElements(By.id("someId"));
for(MobileElement el : listElements){
if(el.getText().equalsIgnoreCase(expected)){
// do some validation //
}
}
Search Result Appear:
input exact value that will return unique, one result so You can easily count.
Sort&Filter with some criteria
remember initial values in items (text like 'Budweiser beer'), do some filtering / sorting, and check text in first element if is changed and if correct logic is applied (eg. sort desc.)
Have to Verify that Sort&Filter is applied correctly
think I answered in 3.
Basically:
'pick' text from items store them,
do some action (search, sort, filter),
'pick' newly changed items caused by 2. step, store them,
compare (depending on what You need...),
To get all items you have to swipe and store them in list.

custom vaadin-grid filter for Polymer 1.0

I’m using the vaadin-grid#^3.0.2 in my polymer 1.0 project.
But I’m looking to create an on/off toggle button that will filter a column based on if the text in two columns are not a match. So if a row in column 1 contains text=“1.1.1” and that same row in column 2 contains text = “2.1.1" then I would keep this row displayed, and hide all other rows. I want to do this in javscript. I’m very new to the vaadin-grid (had so much previous experience with iron-data-table). Anyone have a suggestion on how I can access the filter function?
image of 2 different columns of versions
I tried using the standard filter element but it's too limiting because it only allows me to do string based filtering on just one-specific column, but it's not built so I can do a comparison between strings in two different columns.
<vaadin-grid-filter path="version" value="[[_filterVersion]]">
<input value="{{_filterVersion::input}}">
</vaadin-grid-filter>
One simple way to do filtering that looks at the values of two columns is to not use vaadin-grid-filter, rather just have a input field outside the grid, then filter the array bound to the grid's items property as needed.
<vaadin-textfield on-value-changed="_filterMethod"></vaadin-textfield>
_filterMethod(evt) {
this.gridItems = this.allItems.filter(it => it.col1 !== it.col2);
}
Although I may not fully understand your question as I don't why you are using an input field instead of a button. This filter method approach should work equally well if you call it from a button instead.

Resources