Testing not visible rows in ui-grid with protractor - protractor

My e2e-test for ui-grid is the following:
I'm adding the new item with the name that includes timestamp, saving it to the server.
I'm checking if the item with this name has been added to the ui-grid table.
The problem is that the table can get very big and ui-grid apparently uses lazy loading and puts only the visible rows to the DOM. I found this library of helper methods for testing, but it doesn't provide anything to search for the rows which are not in visible now.
So, question, is one of the following is possible in my Protractor test?
1) can I check how many rows do I have in my ui-grid table?
2) can I search for the certain cell by text, even if the cell is not visible?

1) Can I check how many rows do I have in my ui-grid table?
As long as the row is in the DOM, you can access it. However, if it's not visible you won't be able to do any operation on it (e.g. click). To get number of table rows you can use count:
$$('table tr').count();
2) Can I search for the certain cell by text, even if the cell is not visible?
Yes, you can search for (but not interact with) the cell as long as it's in the DOM. It doesn't have to be visible. But selecting elements by their text is rather fragile, so you should try to use some other method, if possible.

Related

Updating slickgrid autocomplete fields without rerendering the grid

I'm using SlickGrid in a sharepoint environment to display and update data. To save on the the load time, I am populating auto complete fields with options that have only been used in previous lines (with tables with more than 50 lines), and then I am wanting to give the user the option to click on a "Metadata refresh button" located at the top of the autocomplete fields that will go and fetch all available options to repopulate the auto complete field.
<table><tr><td>[ TextField ] </td><td>[ AutoComplete1 ] </td><td>[ AutoComplete2]</td></tr>
<tr><td>Entry1</td><td>Hello</td><td>Goodbye</td></tr>
<tr><td>Entry2</td><td>Hi</td><td>Later</td></tr>
</table>
So if, the user was to create a new line, they would have the options of Hello and Hi in column 2, and Goodbye or Later in column 3 to choose from since they have been used before. If they want the option "Hail!" to appear in column 2, they would have to click the "Update MetaData" button for column 2, which would refresh ALL the cells in that column with all available but previously unused selections.
I know its not ideal, but its a requirement that has been given to me.
I know how to add buttons to column headers and I am updating the array of data that the grid needs for the autocomplete column, but I am at a loss on how to update the column choices without redrawing the whole grid.
Any suggestions?
Check out the newer examples in my repo: https://github.com/6pac/SlickGrid/wiki/Examples
This is probably closest to what you want:
http://6pac.github.io/SlickGrid/examples/example-autocomplete-editor.html
What I have done in the past is create a data property of the cell node to store the object, like:
$jqacContainer.data('queryautocomplete', jqac);
It's then easy enough to get the object from the cell node.
However, this requires proper cleanup of the property to avoid a memory leak. This should be able to be done in editor.destroy(), but I don't think I've checked corner cases, for example where the editor is scrolled offscreen before being completed.

scala, swing : make a table scroll to the last row non empty

I would like to be able to add a row in a table, to achieve this I thought to a button near the table, with the caption "New/Update". if no row is selected, then clicking on this button makes the table "scroll" to display the first empty row, then the person enter the informations in this row, and a second click on the button stores the new row.
But I need to make the table scroll, how can I do this?
I searched on internet and found this : here, but it is in Java and I did not find the scala equivalent to getCellRect method.
please note I did not used a model for the table.
If there's a method that isn't implemented in the Scala version, you can use peer to access the underlying Java Swing version.
So you should be able to access the method in your question, if you have a Table t, using t.peer.getCellRect.

GWT: get backing object for row by id in table

Is there any simple way to get the object, used to render given row in CellTable, by index of the row?
I am using AsyncDataProvider, and don't want to remember lists of data objects, returned from the server. Also I am using MultiSelectionModel, so several items could be selected there and I need to track out which one was clicked last.
I know the index of last clicked row, so I need to get the object, corresponding to the row, somehow.
getVisibleItem? possibly combined with getPageStart if you're using paging and you only know the absolute index.
For your use-case, maybe you could use a customized selection model whose setSelected tracks the last change.

iphone: In group section tableview how do you disable section in search result?

I am using searchDisplayController and it would be searching for the names and also the sections. i would like to know how to show the results of only names and not including the section. Assume the codes are the similar as from apples doc. I have at least 2000 names in there when viewing the tableview itself.
See my answer to this question:
UISearchBar Search table row with text, subtext and image
What you show in a results table is completely up to you. It needn't even have anything to do with the table you're searching! (But of course it usually does, as otherwise you'd confuse the user.) You simply form the data that populates the results table; what data that is, is your call.
So, if you don't want to include any section titles, then when the table inquiring of your data source / delegate is the results table, don't include any section titles! It's your code, it's your table, do whatever you want. You are the one implementing tableView:titleForHeaderInSection: to return titles; if you don't want titles, return nil instead. Of course, if the data source for the real table is the same object as the data source for the results table, then tableView:titleForHeaderInSection: will have to examine the incoming tableView parameter to see whether it is the real table or the results table, and make its choice of what to return based on that.
I would like to a bit more of your problem as it is not much clear. I don't actually get this line:
i would like to know how to show the results of only names and not including the section
For searching, it is best to search in a dictionary/array and show the result in tableview by [tableView reloadData].

Updating GWT Cell Table at runtime

I am trying to update a cell table at run time, the cell table gets its date from a list
Cell_Table.setRowData(0,AllMessages);
I am trying to update the List AllMessages then do this Cell_Table.redraw(); with no success.
I am trying this do this again Cell_Table.setRowData(0,AllMessages); with no success AS WELL
when I am using the same technique to add rows, everything is ok but when i am removing some data from the list feeding it, the cell table is not being updated!
by
John LaBanca
# GWT Discussion
setRowData(int, List) replaces the range of data. So, if the list gets
shorted, it doesn't touch the items that appear after the end of the list.
You have to update the row count as well:
table.setRowData(0, NewMessages);
table.setRowCount(NewMessages.size(), true);
Or, you can use the new version of setRowData that does not take a start
index (since GWT 2.1.1):
table.setRowData(NewMessages);