Forum Discussion
SaudaFurkhana
7 years agoQrew Cadet
Hi Dan! Thank you for the response. Here are the details.
1) My App variables and Formula Field in parent table:
a) iol => <img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=
b) /iol => &rand='+new Date().getTime())};">
c) Childs2:
[iol] & "module.js" & [/iol]
&
"<div class=QBU_Childs data-rid=" & & "></div>"
2) HTML source of the tag that is getting rendered in the parent report
<tr>
<td class='FirstColumn'><img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};"><div class=QBU_Childs data-rid=444></div></td>
<td align=right class='NoWrap'>444</td>
</tr>
<tr>
<td class='FirstColumn'><img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};"><div class=QBU_Childs data-rid=445></div></td>
<td align=right class='NoWrap'>445</td>
</tr>
3) Data in my parent/child tables:
Parent Record #444 has 3 children - child1 value: ghi, child2 value: def, child3 value: abc)
Parent Record #445 has 3 children - child1 value: 123, child2 value: 456, child3 value: 789)
Expected data output is to have parent record and reports in the parent table to display:
444 - ghi, def, abc
445 - 123, 456, 789
4) module.js is same as in https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=464&_ga=2.235786049.17404487.... Here are the details of the code changes that I tried:
a) I changed dbid, dbidParents,dbidChilds, apptoken, relatedParentFid, relatedParentLabel, clist
- clist is fetching two fields: 1) child unique record id # and 2) data-value that I want to concatenate and display in parent table
b) I modified the following two lines in js file. Please see the screenshot for the output related to Code2 and Code3
>> Code1: as it is in Pasties example
var markup = Mustache.render(template, item);
$("div." + qbuClass + "[data-rid=" + rid + "]").html(markup);
Output: no result within in the parent record and parent table report
>> Code2: using console.log, I saw that rid contained the child record value that I need to display in parent record
var markup = Mustache.render(template, {comment: rid});
$("div." + qbuClass).html(markup);
Output:
- always lists the last child value in the individual parent record
- parent table report has the last value in the loop for both the records (I think this is because I eliminated unique identifier for the div?)
>> Code3: I changed .html to .append in code2
var markup = Mustache.render(template, {comment: rid});
$("div." + qbuClass).append(markup);
Output:
- lists the concatenated child values within an individual record
- but I think due to .append(), all the records in the report have the concatenated list of child values for "all" records (I think this is because I eliminated unique identifier for the div?)
5) Dan, should we change something in this function as well?
function ridsToQuery(rids, fid) {
fid = fid || "3";
return "{" + fid + ".EX." + rids.join("}OR{" + fid + ".EX.") + "}";
}
1) My App variables and Formula Field in parent table:
a) iol => <img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=
b) /iol => &rand='+new Date().getTime())};">
c) Childs2:
[iol] & "module.js" & [/iol]
&
"<div class=QBU_Childs data-rid=" & & "></div>"
2) HTML source of the tag that is getting rendered in the parent report
<tr>
<td class='FirstColumn'><img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};"><div class=QBU_Childs data-rid=444></div></td>
<td align=right class='NoWrap'>444</td>
</tr>
<tr>
<td class='FirstColumn'><img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};"><div class=QBU_Childs data-rid=445></div></td>
<td align=right class='NoWrap'>445</td>
</tr>
3) Data in my parent/child tables:
Parent Record #444 has 3 children - child1 value: ghi, child2 value: def, child3 value: abc)
Parent Record #445 has 3 children - child1 value: 123, child2 value: 456, child3 value: 789)
Expected data output is to have parent record and reports in the parent table to display:
444 - ghi, def, abc
445 - 123, 456, 789
4) module.js is same as in https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=464&_ga=2.235786049.17404487.... Here are the details of the code changes that I tried:
a) I changed dbid, dbidParents,dbidChilds, apptoken, relatedParentFid, relatedParentLabel, clist
- clist is fetching two fields: 1) child unique record id # and 2) data-value that I want to concatenate and display in parent table
b) I modified the following two lines in js file. Please see the screenshot for the output related to Code2 and Code3
>> Code1: as it is in Pasties example
var markup = Mustache.render(template, item);
$("div." + qbuClass + "[data-rid=" + rid + "]").html(markup);
Output: no result within in the parent record and parent table report
>> Code2: using console.log, I saw that rid contained the child record value that I need to display in parent record
var markup = Mustache.render(template, {comment: rid});
$("div." + qbuClass).html(markup);
Output:
- always lists the last child value in the individual parent record
- parent table report has the last value in the loop for both the records (I think this is because I eliminated unique identifier for the div?)
>> Code3: I changed .html to .append in code2
var markup = Mustache.render(template, {comment: rid});
$("div." + qbuClass).append(markup);
Output:
- lists the concatenated child values within an individual record
- but I think due to .append(), all the records in the report have the concatenated list of child values for "all" records (I think this is because I eliminated unique identifier for the div?)
5) Dan, should we change something in this function as well?
function ridsToQuery(rids, fid) {
fid = fid || "3";
return "{" + fid + ".EX." + rids.join("}OR{" + fid + ".EX.") + "}";
}