I understand that the columns are rendered before any grid data is
retrieved (I'm using JSON-P to populate the grid), but I'd be willing
to sacrifice hitting the database twice and loading just the first row
of the table to get data about the appropriate widths and then
throwing it away. It's also not possible for me to hard-code the
column widths, since the same grid will display many different tables.
Has anybody else run into this problem? What do you do to solve it?
Thanks,
Adam
--
To unsubscribe, reply using "remove me" as the subject.
crated a plugin for slickgrid auto column size. checkout
--
You received this message because you are subscribed to the Google Groups "SlickGrid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slickgrid+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
function textWidth(strText, blnBold) {
if ((strText || "").length == 0) {
return 0;
}
var strId = "acs-text-width" + (blnBold ? "-bold" : "");
var wesWidth = $("#" + strId);
if (wesWidth.length == 0) {
wesWidth = $("<span id='" + strId + "'></span>").appendTo("body");
}
return wesWidth.html(strText).outerWidth(); // * 1.15;
}
#acs-text-width
{
position: absolute;
left: -1000px;
top: -1000px;
font-family: Verdana;
font-size: 11px;
}
#acs-text-width-bold
{
position: absolute;
left: -1000px;
top: -1000px;
font-weight: bold;
font-family: Verdana;
font-size: 11px;
}
To unsubscribe from this group and stop receiving emails from it, send an email to slickgrid+unsubscribe@googlegroups.com.
for (var j = 0; j < arrTotals.length; j++) {
if ((arrTotals[j]["~font"] || "") == "BOLD") {
intCTemp = textWidth(arrTotals[j][pnList[i]], true) + 22;// + 10;
} else {
intCTemp = textWidth(arrTotals[j][pnList[i]], false) + 22;// + 10;
}
if (intCTemp > intCInfo) {
intCInfo = intCTemp;
}
}
--
You received this message because you are subscribed to the Google Groups "SlickGrid" group.