Remove Style from table in Code Behind - css

This should be a lot easier than it appears to be, but I'm having an issue with it.
Conditions
If upon entering this specific page, if there is only one record in the grid (based on a status value in a dropdown), hide the grid and show a table with the details of that record.
If there is more than one record, display the grid with the records.
When a record is selected, display the table with the details of that record.
When I go into the page currently, there is only one record, so it is displaying the table. If I change the value of the dropdown to another status, more than one record is in the grid and the table is hidden. Previously (by another programmer) it was being set to Visible = false. Obviously, this is not a property of the table. However, it previously worked as when someone would select a row, they would set the Visible = true and the table would show.
I've now changed it to hide by using:
tblDetails.Attributes("style") = "display:none"
However, trying to replace the Visible = true is not working:
tblDetails.Attributes.Remove("style")
I have also tried:
tblDetails.Attributes("style") = ""
Someone please point out to me the solution that is going to make me slap my forehead. Thanks.

use setAttribute(attr,value) to change the value of each Element You want
like below example
yourelement.setAttribute("style","");//it is to change value
yourelement.removeAttribute("style")//it is used to remove style attrb from your element

Related

Ag-grid dynamically span entire row

I have a grid that presents database entities one per row with some crud options (the crud options are icons in their own cells). When the delete button is clicked, the design calls for the entire row to be turned into a confirmation message with buttons to continue or cancel.
Apparently you can give a function for colSpan on each colDef. I tried giving the first colDef a span equal to the number of displayed columns in the case that the row data has a property isDeleting === true, while clicking the delete icon would set the row data's isDeleting property to true.
I was unable to get this to work, and even if I were to get it to work, I'd need to be able to dynamically change the cell so that it contains the confirmation message.
Any help is greatly appreciated.
After a very long day of searching, I found this article on "full-width" rows. You can provide your gridOptions with an isFullWidthCell function, plus fullWidthCellRenderer and fullWidthCellRendererParams properties, and the full width of the row will be populated using the renderer according to the params (as is the case with a cellRenderer in a ColDef)
So, my delete button component can set a piece of data that the isFullWidthCell function can check for, and if it finds it, it will use the cellRenderer provided.
AgGrid seems to have thought of everything.

Trying to display the export value of a dropdown menu selection in Adobe PDF

Let me start off by saying I have very limited knowledge of Javascript.
I've got a Dropdown menu called: CustomerType with 6 values in it.
Basically I just want whatever is selected in the dropdown to display again in another part of the PDF.
Can anyone help?
First set the properties on the dropdown to commit the value immediately. See image.
Then on the "calculate" script for the other field, enter the JavaScript below. You'll need to change the field names to your actual field names.
this.getField("myOtherField").value = this.getField("myDropdown").value;
You'll want to set the other field to read-only as well since the value is calculated.

How to add and edit record directly on the table widget Google AppMaker?

I have something like this to enter staff details list. Above is the table list. User click button below the table to add new list record. Then fill in the list details on the form beneath it.
My question is how can I just allow user to enter/fill in the list details directly on the table itself. Not only that, also user able edit record whenever the user clicks the records and wanted to change them.
The example I am providing is specifically for a datasource in autosave mode, so you will need to make some adjustments since it appears that your datasource is in manualsave mode. First you will either want to recreate your table and in the table creator choose 'Editable' which will automatically place inputs in your table row vs labels. Alternatively you can just replace all your labels with Textboxes, Dropdowns, or whatever your input should be. See the image of the table creator below:
Since in my example I used a 'Insert Only' form I moved my 'Create Button' and my 'Clear Changes' button inside the formbody, then set the flow direction of the formbody to horizontal and then matched the spacing of the form fields to the same as my table row and dragged the formbody to be between the tableheader and the tablebody(list) element. See the image below:
Again you will want to make adjustments to fit your needs such as rearranging where your 'Save' and 'Reset' buttons appear and in manualsave mode you may be able to skip the formbody entirely since your 'Add Details' button should automatically create a new table row anyways which you will then be able to edit directly in the table, you may just need to find it first but generally new rows should just be added on the bottom of your current datasource page.

How to mark record in grid without checkbox?

I have two grids. The first displays keys, and the second displays a list of related items in another table. Since the grids are on different tabs, I put a filter on the pageActivated method for the second grid's tab.
Some pseudo code to get my point across without posting 200 lines of x++
override page2Activated() {
dataSource2_ds.removeFilter();
dataSource2_ds.filter using grid1Field.valueStr();
}
This works nicely, as long as grid1 has rows in it when the form is opened. If there are no rows when the form is opened, even after adding a row to grid1, something doesn't get updated, and grid2 will always be blank.
Then, I tried looking at the datasource instead of the grid fields.
override page2Activated() {
dataSource1 firstTable;
firstTable = dataSource1_ds.getFirst(true);
dataSource2_ds.removeFilter();
dataSource2_ds.filter using firstTable.recID;
}
The problem with this one is that it only works if you click the checkbox next to a record.
I'd like to to work with a highlighted record in grid1, without having to click the checkbox.
Any suggestions?
Question answered in comments above. Posted as answer so the question can be marked closed.
Rather than using code to manually filter the records, link the tables using the datasource properties JoinSource and LinkType. Set JoinSource to the linked table and LinkType to Active.

Can we copy the value of one field to another in a repeating table of infopath form?

Hi guys can anyone tell me how to copy a field value in a repeating table to another field when we insert another row. It is just like amazon checkout process. In Amazon checkout process we have to click a check box when our billing address is same as our shipping address.
In this scenario am having one text box and drop down box fields in a repeating table. When am writing something in the text box and inserting another row. here come the problem I have inserted a value in the drop down box, when the value is selected in the drop down box the textbox value from the parent should be copied to the child node. This has to be done without any code behind.
Please help me regarding this issue
You could probably do this using the default value of the child node.
The default value can reference another field either on your main datasource or any secondary datasource.
I would assume that you don't want this updating when the user adds another child node. If that is the case then you will need to uncheck the "Update this value when the value of the foumlua is recalculated."

Resources