on 02-09-2011 8:17 PM
Hi All,
I have a requirement to display four item texts in one of the table column. I had created a subform with four texts in that column. I am getting the data as required, but by default the table row size has increased because of four texts in the column. At times, i have only data in two texts, still getting the default size of the row(0.41in height), how can i adust the height based on the data. How can i adust the row of the table dynamically.
Thanks,
Kumar
Hi Kumar,
If your requirement is to adjust the height of the entire row dynamically, use the script below:
table.row1.Field1.minH = "2in";
Thanks & Regards,
Sanoosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumar,
I did similar to this, where as my table is entirly designed in subforms, so there is no auto setting of the columns of a row.
I had the below code, which finds the maximum height of a coulmn element and sets its height to all of the coulms of a row instance.
I call this function on layout ready event of the row, as below
ItemGenerator.setHeight(this);
function setHeight(rowData){
if(rowData.presence == "visible"){
// xfa.host.messageBox("height set start in layout ready");
var yearH = parseFloat(xfa.layout.h(rowData.FinYear,"in")).toFixed(3);
// xfa.host.messageBox("1");
var ipaH = parseFloat(xfa.layout.h(rowData.IPAType,"in")).toFixed(3);
// xfa.host.messageBox("2");
var expenseH = parseFloat(xfa.layout.h(rowData.ExpenseType,"in")).toFixed(3);
// xfa.host.messageBox("3");
var descH = parseFloat(xfa.layout.h(rowData.Description,"in")).toFixed(3);
// xfa.host.messageBox("4");
var payH = parseFloat(xfa.layout.h(rowData.PayType,"in")).toFixed(3);
// xfa.host.messageBox("5");
var payconH = parseFloat(xfa.layout.h(rowData.PayConditions,"in")).toFixed(3);
// xfa.host.messageBox("6");
var acqconH = parseFloat(xfa.layout.h(rowData.AcqittalCond,"in")).toFixed(3);
// xfa.host.messageBox("7");
var maxHeight = Math.max(yearH,ipaH,expenseH,descH,payH,payconH,acqconH)+"in";
var marginBottom = parseFloat(Math.max(yearH,ipaH,expenseH,descH,payH,payconH,acqconH)- 0.2).toFixed(3)+"in";
// xfa.host.messageBox("max height = "+maxHeight);
// xfa.host.messageBox("bot margin = "+marginBottom );
rowData.h = maxHeight;
rowData.IPA.h = maxHeight;
rowData.IPA.margin.bottomInset = marginBottom ;
// xfa.host.messageBox("8");
rowData.FinYear.h = maxHeight;
// xfa.host.messageBox("9");
rowData.IPAType.h = maxHeight;
// xfa.host.messageBox("10");
rowData.ExpenseType.h = maxHeight;
// xfa.host.messageBox("11");
rowData.Description.h = maxHeight;
rowData.ReqAmt.h = maxHeight;
// xfa.host.messageBox("11");
rowData.RecAmt.h = maxHeight;
// xfa.host.messageBox("12");
rowData.PayType.h = maxHeight;
// xfa.host.messageBox("13");
rowData.PayConditions.h = maxHeight;
// xfa.host.messageBox("14");
rowData.AcqittalCond.h = maxHeight;
// xfa.host.messageBox("15");
rowData.Remove.h = maxHeight;
rowData.Remove.margin.bottomInset = marginBottom ;
// xfa.host.messageBox("finally");
}
}
Hope something of this sort might helpful to you.
Cheers,
Sai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.