Datatables source populate - datatables

I am trying to show results from object nested results to jQuery Datatables
Also on each search i must refresh header values by users search dates(between)
But all known methods failed
Here screenshot of data and header values
How to populate object nested output on datatable?
screenshot here

Related

Script to extract and assign values from a nested JS object

I presently have a nested JS object of the format:
var oNames = {
Adobe:{LastUpdate:'03/09/2022',Website:'adobe.com',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'',SecondaryCC:'',PrimaryBank:'',SecondaryBank:'',SQ1:'First girlfriend',SA1:'Denise',SQ2:'Grade school attended',SA2:'OLPH',Notes1:'',Notes2:''},
Amazon:{LastUpdate:'10/06/2020',Website:'amazon.com',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'Discover',SecondaryCC:'Capital One',PrimaryBank:'',SecondaryBank:'',SQ1:'',SA1:'',SQ2:'',SA2:'',Notes1:'',Notes2:''},
AmericanGiant:{LastUpdate:'01/25/2022',Website:'american-giant.com',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'',SecondaryCC:'',PrimaryBank:'',SecondaryBank:'',SQ1:'',SA1:'',SQ2:'',SA2:'',Notes1:'Best Hoodies Made in the USA',Notes2:''},
Asus:{LastUpdate:'11/05/2022',Website:'https://www.asus.com/us/',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'',SecondaryCC:'',PrimaryBank:'',SecondaryBank:'',SQ1:'',SA1:'',SQ2:'',SA2:'',Notes1:'Goto for MB & Laptop Computers',Notes2:''},
.
.
.
]
Can someone please provide me with a sample script that loops through the object above to obtain the values for the properties in the object above associated with each name using the variable, cName, that derives its value from a selection made by an end user from a drop-down box form field that resides on a PDF form. In short, the value provided by the variable 'cName' will be one to match any one of the name values in the object, i.e., Adobe, Amazon, AmericanGiant, Asus in which event the remaining fields residing on the PDF form will be populated with those property values associated with the name selected. Hope this explanation is clear. Unfortunately, I am not as familiar working with object pairs as I am with arrays and as such am stuck creating a script that works with a nested object as provided above. Thank you ahead of time.
for(j=0;j<15;j++){
f=getField("inf."+j);
cName = oVendors[event.value][j];
}
"inf."+j denotes 1 of 15 PDF form fields to be populated from the values in the object associated
with the name in the object equal to 'cName', the name selected in the combo box that resides on the PDF form.
Upon further study of the JS object and its methods, the following script is
required to extract names stored inside a JS data object in a hidden text field
used to populate a drop-down box on the PDF form as follows:
dsFld =getField("dataSrc");// call getField method used to obtain the stored
data value in the hidden text field that resides on the PDF form
oVendors = JSON.parse(dsFld.value);// parse the JSON string to convert to a JS
object to complete tasks to follow
f = getField("cbNames");// call the getField method to get the
drop-down combo box field or later use
aNames=new Array();// create the temp array
for(var key in oVendors){// script to populate the temp array from names
taken from/stored in oVendors data object
aNames.push(key);
}
aNames.sort();// sort the names alphabetically in the temp array
f.setItems(aNames);// assign names from the array to the drop-down
Combo Box field on the PDF form
f.insertItemAt("Add or lookup and select a name");// Insert text item at
the topmost item provided in the drop-down combo box list
dsFld.value=JSON.stringify(oVendors);// convert JS obj back to a JSON
string value stored in the hidden text field
Sorry for the initial ambiguous post and any inconvenience to the forum.

How to use Attachment Image from Table in Access Form and Report Headers?

I have an Access database used by many projects and each project have its logo and information stored in table called company_info_tb.
I stored the logo in Attachment field type; each project can modify its info and logo to be used in its printed reports.
How I can call the project logo to be shown in the headers of Access forms and reports using a Bound Object Frame or another way?
I tried using dlookup in the Control Source of the Bound Object Frame:
Dlookup("LOGO","company_info_tb")
And using LOGO that was shown in mainform, by putting this code in the Control Source:
=forms!main_frm!LOGO
But it doesnt work.
Options:
include logo attachment field table in report RecordSource, without a join clause the logo record will associate with each record of data table/query (Cartesian relationship), place bound control only in header section - not appropriate for data entry/edit form because the resulting query is not updatable
save the logo image externally and store path in text field then use DLookup expression or Cartesian query
subform/subreport in header
Recommend using Image control and set its ControlSource property either by binding to attachment field or text field or expression to construct external path. A BoundObjectFrame control must be bound to an OLEObject field and options 1 or 3 would work.

Angular5 form array validation for dynamically created fields

I am using angular5 in that I am using form array to dynamically generating the fields. Initially I want to load form array as 0 files. If I am clicking plus button I want to add two fields. With validation.
If from array is empty i.e now fields are created I have to submit the button without this dynamic fields.
If fields are created I have to set validation without entering information in fields i won't enable submit button.
If I am setting validators.required in form array I can't able to submit without entering in first two fields
I need a solution for this one guys.
Assuming you are using template driven approach, the place where you are looping through your data to generate dynamic controls, create an index variable like *ngFor=" val in collection; let i=index" and then use that i to make each control unique by appending i with the name of the control like <input type="text" name="txtId-{{i}} #txtId="ngModel" [(ngModel)]="someId" />
Now if you try to use txtId.valid inside the loop it will be unique for every row.

How to get dynamic created table's total column and row using Request.Form in vb.net

I am doing my project in Vb.net using MVC 4.0
I have created dynamic table and in that textboxes in td using javascript and now i want to get that table's total row and column as well for further process in Controller function.
How I can get using above using VB.net?
I have used Request.Form but the id of the textboxes in table is created uniquely so first I want to find the total column and row so based on that I can move further and check using for loop.
It seems like if you are generating your table through javascript you should also be able to set the value of a hidden field to the value you are outputting to your totals column. If you created a hidden field with the value set you should be able to access it from the Request collection. If it is not actually in a field that gets posted back you will only be able to access the value from the client-side.
document.getElementById("myInput").value = "Value you are outputting to your "total" cell
[Solved]
I got all the controls on code behind by it's name by using FormCollection just i need to do is post back the form using form action method because with using ajax i am not getting the formcollection in code behind but directly using form action method i can get all the controls name.
These are the textbox ids by which i can get the value just need to do further process like:
For Each _formvalues As String In formcol
formcol(_formvalues)
Next
fomcol is an object of FormCollection,_formvalues is used for moving one by one name coming in formcol and to take the data inside means name just write formcol(_formvalues) that's it.

How to Access DataTable Information Filled By a Module From a Form

I have a DataSet named BillMat.xsd
When my application loads, a module fills that dataset's DataTable with the correct information.
My question is ... How can I access that DataTable's already filled information from another form?
Here's how I tried to access it on one of my forms:
Dim View As New DataView
View.Table = BillMat.Tables("dtBillHeader")
But I get the following error:
If I create a new instance of my dataset and store it in a variable, I'll be able to get rid of this error message but it will also get rid of all my data in my dataset's datatables ... Is there a way to access a DataTable's information from another form?
You need to fix it so both forms are referencing the same DataSet or DataTable object. If one is a "child" form of the other, such as a dialog, you can pass it from the parent to the child via a property. Otherwise, ideally, the same data object would be injected into both forms by some third object which created both of the forms. Short of all that, you could create a singleton or global variable, but please don't!