Isotope: keep an element in the first row, last column of the grid - locking

Using Isotope, I would like to know how to keep an element always in the first row, last column of the grid, no matter how many columns there may be.
Not the corner stamp function since it makes the element appear outside of the grid, unaligned with the other elements.

Related

How can I determine whether a table row immediately follows a page break

Given a Word table which spans several pages, how can my code determine that a table row is the first following an automatic page break? Note that table rows are of different heights thus a solution of the form "every 13th row is the first row on a new page" won't work.
The point of this would be to add extra text in the first cell at the top of every new page.
Use wdActiveEndPageNumber for that table row. Be sure that row is as big as it's going to get before checking the page number.
n = word.ActiveDocument.Tables(a).rows(b).Range.Information(wdActiveEndPageNumber)
If the table is sufficiently large that it splits over several pages then you compare the page number of consecutive rows until the page number changes. There are no pagebreaks to speak of.

Rearrange rows in slick grid

We have requirement to rearrange slick grid rows.
I have up/down icon in each row, I want to achieve animation like, clicking 'up' icon should move rows up by '1' position, but cursor must not shift its focus from current row. And other rows should rearrange their position in respect to the 'clicked row'.
Please suggest solution to this problem. Thanks
You essentially want a sorting function. The method I'd choose depends a bit on how the back end database stores the sort order, if you are persisting to a database.
If you are not persisting the data,
create an extra column SortOrder, sort by whatever other columns you want to be the default sort order and set SortOrder to 1, 2, 3, ... , n
create the buttons using a formatter, and make the up/down buttons call javascript that
switches the sort number with the row before/after
resorts and rerenders the grid
sets focus (if necessary) to the desired row using grid.setActiveCell() and grid.focus()
Pesonally, I store SortOrder as an int database column, and set it to all zeroes initially so that secondary default sort columns can be used if no custom sort is desired. However the sort index algorithm is significantly more complex.

OpenRefine - Fill between cells but not at the end of the list

I have a list of stock prices for several stocks. Some of the values are missing due to weekends, holidays and probably other reasons.
The gaps are not consistent. Some are two days and some are more than that.
I want to fill the gaps with the last known value but not at the end of the list.
I have tried in Excel to test a few cells below and if it's now empty, do the fill. The problem is that due to the inconsistency of the gaps, it's a tedious task to change the function for all the cases.
Is there a way to test for the end of a list?
UPDATE - added a screenshot.
See this screenshot. I want to fill where the blue dots are. The red dots are at the end of the list and I don't want to fill those cells.
I am looking for a way to detect the end of the list and stop the filling when the end is detected.
I think this is pretty difficult in OpenRefine and probably a different tool would work better. The main issue is that OpenRefine does not offer the ability to easily work across rows so 'summing a column' (or part of a column) is tricky - this is mentioned in https://github.com/OpenRefine/OpenRefine/issues/200
However, you can do this by forcing OpenRefine in Record mode with the whole project containing a single record. Once you've done this you can access all values in a column using syntax like:
row.record.cells["Column name"].value
This gives an array of all the non-blank values in the column. Since this ignores blank values, in order to have a true view of the values in the column you have to fill in blank cells with a value.
So I think you could probably achieve what you want as follows:
For each column you are going to work with do a cell transform to put a dummy value in empty cells - e.g. if(isBlank(value),"null",value)
Create a new column at the start of your project and put a single value in the very first cell in that column
Switch to Record mode
At this point you should have a single 'Record' in your project - e.g.
You can now access all cells in a column using syntax like row.record.cells["Column 1"].value. You can combine this with 'forRange' to iterate through the contents of this array, using the row.index as the marker for the current row.
I used the following formula to add a new column to the project:
with(row.record.cells["Column 1"].value,w,if(forRange(row.index,w.length(),1,i,w[i].toNumber()).sum()>0,"a","b"))
Then...
Change back to 'Row' mode
Remove the 'null' placeholder from the original column
Create a facet on the 'fill filter' column
In my case I filter to 'a'
Use the 'fill down' option
Remove the filter
And remove the 'record' column
Rather a long winded way of doing it to say the least, but so far I've not been able to find anything better while not going outside OpenRefine. I'm guessing you could probably compress steps 5-11 into a single step or smaller number of steps.
If you want to access the array of cell values using Jython as suggested by iMitwe you need to use:
row["record"]["cells"]["Column 1"]["value"]
instead of
row.record.cells["Column 1"].value
(step 5)
I am doing this on the top of my head, but I think your best chance my be using the fill down option in record mode:
first move your column to the first column and switch to record mode.
then use the following GREL: row.record.cells["data"].value[-1] where data is the name of your column
The [-1] will take the last value and fill the blank. For the case with the red dot, since there is no value it should remains empty. Let us know how it goes.
Unless there's something I am missing or not seeing...
I would have just sorted reverse (date ascending) on the Date column, then individually use Fill Down on each column, except for that last column where you could then use a Date facet on your column Date to specify the exact Date range you wanted to work with, then fill down on that last column, then remove the Date range facet.

Defaultly focusing last column when applying alwaysEditing=true attribute in the Dojo Datagrid

I have number of columns to be in always edit mode so i am applying alwaysEditing=true for No of Columns the Pointer is always focusing the last column even if i select any other column in the Grid.
I need a solution that whenever i click any column the Pointer should focus on the selected instead of last column in the Grid.

Adding a row (not a column) of a type (checkbox,dropdown) in datagridview

I have a datagridview that is only two or three rows long. It has 7 text columns, one for each day of the week (Monday - Sunday). I'm creating a scheduler, so basically on the left side I have added text to the row headers to assign to it. I.e. Enabled (let's say for Tuesday), start time and end time. This allows the user to schedule as need be.
Here's a picture of it right now:
What I want to do is possibly change the enabled row, or the start/end time to a particular type. So the enabled will be a checkbox and the start/end times will be drop down menus instead of these text boxes.
My question is, what's the "best" way to add a row of a certain type? Obviously columns are done easily, but is there a common method for a row type other than looping through and adding individual cells of that type to the datagridview?
The type of each cell can only be pre-determined by the column, not the row. As a result, you're going to have to add each cell individually. You can actually put a cell of any type anywhere you want. You simply create a cell of the desired type and assign it to the Item property of the grid, e.g.
myDataGridView(columnIndex, rowIndex) = newCell
You will simply have to use a For loop to do that for each valid column index with a single row index. Note that you'll have to create a new cell for each column, not reuse the same one.