Iterating all rows and changing a specific value ends up in a disappearing table - footable

I have following problem: I have a small application running where i have implementes a language switching function. Therefore i need to change the datetime columns in footable for the right date format.
My idea was to iterate through all rows, get the date value, recalculate it in the right format and write it back to the table. But This approach is not working properly, when i try it, you can see the very first row changing, and then the whole table disappears. I have attached some screen shots and the relevant code to explain the problem...
My Code (for iterating the rows and changing the value):
var ft = FooTable.get("#spiele_data");
$.each(ft.rows.all, function(i, row){
v=row.val();
var m = moment(v.sp_timestamp, 'L LT');
v.sp_timestamp=m.format('L LT');
row.val(v);
});
This is what happens:
Table is loaded and displayes properly
After changing the language => see the first line
Immediatley after that the table is gone
What am i doing wrong or is there a better possibility to change specific columns in all rows?
Best regards
Christian
+EDIT: One more thing: the $.each-loop is iterated completely. I've tested that by writing the index to the console.

$('table').trigger('footable_redraw');
You need to call redraw to see footable again

Related

Repeating a result on a line on the rows/lines below untill that result changes?

Image showing problem
I want to know if there is a way of repeating the result of a column downwards until the change of result.
Attached image shows the problem.
I need 9.1stWC column to fill the number(which is actually a string) all the way down until that number changes.
The column is not null where the blank fields are (9.is null, shows this) so I'm going to have to write additional formulas to show I'm guessing.
I've used previous function but that only shows for the next line down then is blank after.
The replicate string function will go across the column not downwards.
I've looked at a stringVar but cant find a way of making this work on this report.
I'm reserved about grouping as I have a lot of other filters and by grouping I could possibly loose the sequence depending on what I group by.
My aim is to show WC which are equal to the current op line by doing a simple formula after I have managed to populate that column
I will assume your column is a field named {Result.WC}.
Try this:
Create a formula. Let's call it #LastWC.
Use this code in the formula:
shared stringvar sharedLastWC;
if not isnull({Result.WC}) and {Result.WC} <> "" then sharedLastWC := {Result.WC};
sharedLastWC; //returns
Replace the field by the formula.
The idea behind this is to set the shared variable when the field is not blank and not null. So, the variable will hold the last "filled" value.
I can't make a test with the purposed solution right now, but give it a try and make adjusts if you need. Tell me if it does not work.
If the first row can be empty, you may need to create an aditional formula do start the value of the shared variable in the header of the report.

RDLC, too large table is cut but displayed at the same side without line break

I encounter a problem creating my RDLC file.
I fill a table using a dataset and my report is in landscape view.
When I export to word format, I want the table to be cut and the other parts of the table displayed below the first part. Unfortunately for the moment, my table is cut but the other parts of the table are displayed on the side of the first part:
So even if I defined a fix size (Letter size) for my report, when I try to print the word export, the size changes due to table size.
Have you ever encountered the same problem?
'Split the table and put the split part below the original part' i.e 'wrapping' tables. is not a standard behaviour.
I think you'll have to do that manually, i.e. put two tables in the report, with the same dataset, one below the other.

How to ensure tableView.scrollTo() displays correctly when initializing the table

I am building a screen where the system jumps to rows in a TableView based on error conditions. Not all rows will be touched. My table view can hold approximately 23 rows. When there are less details than that I have no issues.
However when there is more and the first item in error is off the visual flow, I get weird rendering on the first access only.
In this example, I have 63 rows of data, and the first row that needs to be reviewed is like 35.
When the system determines the row it needs to access I jump there by first selecting the row and then scrolling the table to it:
When I initialize the table:
tableView.getSelectionModel().setCellSelectionEnabled(true);
tableView.setItems(sorted);
tableView.setEditable(true);
In the call to select the next row:
int nextRow = determineNextRow();
tableView.getSelectionModel().select(nextRow, columnToEdit);
tableView.scrollTo(nextRow);
At this point the table scrolls off top & bottom. And the display looks like this:
After entering the amount, it drops to the next line and everything looks OK.
I am not quite sure how to correct the initial landing.
Thanks.

apex tabular form icon link column

I am working with a wizard-generated Tabular Form column that needs to display an icon which launches a Javascript function and pass the row value into the function when clicked. The function launches a popUp2 window which sets the values of other fields on that row. So the row number is crucial, but it is always 0 for newly-created rows (in APEX 4.0.0.00.46). I managed to solve that problem by storing the rowNum of new rows into my Updated By column during AddRow.
What I have now is an Updated By column ("Lookup" Heading) which stores the row number of new rows, has onClick="javascript:usePopup(this);" in the Element Attributes which launches the popUp window function, and then gets any values under 2 digits wiped before submit. This fills the correct fields and submits to the table with no problem.
I can't keep using the Updated By column for this function, though. There are currently reports running on this table, so I can't add a new column to the table. I need a dummy column to display the icon, temporarily store the Row Number of newly created rows, and not mess up the MRU. It is f08, so the value of f08_0005 needs to be 0005. I tried making a null column with
select
"FUEL_USAGE_DETAIL_ID", ...
"EXPENSE_TO_PROJECT",
"EXPENSE_TO_TASK",
NULL Lookup,
"UPDATED_BY",
"PROVIDER"
from "#OWNER#"."FUEL_USAGE_DETAIL"
but that can't submit. I get the Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "01A949FAF0B3A91914ECACCDC9BBA9E6", item checksum = "B6ADF86455B14EF691B2AFB314926A0D".
Please help me create a null column to display this icon, store the row number of all the rows (including the brand new rows), and not mess up the MRU. If you need pictures of what I have and what I need, see my other thread: https://community.oracle.com/thread/3649771 Thank you!
Fractal65,
Do not add any null column in tabular form.
just go to>>Edit tabular form attribute make following change
you will get it position as f02_000X (x-rownum)
now uou can use this rownum value in javascript or anything.
Hope this helps.
I had a similar error with my last project. Do you have a none displayed row selector? Please try to delete it to see if it will work.

iTextSharp - finding end of page

Is there any way to find the current page is going to end in iTextSharp. For example,
say there are some 10 records which needs two pages to be written down at the end of the first page i wish to add '(contd on nex page'). IS there a way to do this. Will finding the end of page be an answer for this or is there a way to find the line number on which writing is done, so that i can make a calculation to decide whether to add a message of my choice and proceed to the next page.
any advise is much appreciated :)
Thanks a zillion
Usually, this is done by defining a footer for the table. When the table breaks automatically, iText will show that footer. Of course: you don't want this footer to show up on the last page (after the final row of the table). That's why there's also a method to skip the last row.
This example shows you how to create a table with headers and footers. This is the link to SkipLastFooter.
Note that saying that "finding the line number" would solve your problem is wrong for two reasons:
There is no such thing as a line number in a PDF file. You have a MediaBox and you draw content on the canvas defined by the MediaBox using coordinates.
There's a way to get the current Y-position on a page after adding an object to a document. You can get the Y-position before adding a table and after adding a table, but not while you're still creating the table.
An alternative solution to the one I suggested above, woult be to use table events.
If you really need to find the end of the page, and are not using a table with a footer row that will be printed at the end of each page, you can use the PdfWriter object as follows:
var remainingPageSpace = pdfWriter.GetVerticalPosition(false) - pdfDocument.BottomMargin;
This will give you the remaining space on the page, from which you can determine what you want to do next.
If you are using tabular data however, it is much preferred to use a PdfPTable and take advantage of the footer row feature.