Hi,
After update WEBCore to 1 3.4 version I have an error:
Uncaught ReferenceError: resizableGrid is not defined
at Object.EnableColResize (dotwpwa.js:19666)
at Object.RenderGrid (dotwpwa.js:19534)
at Object.UpdateElement (dotwpwa.js:19562)
at Object.EndUpdate (dotwpwa.js:7233)
at Object.AfterLoadDFMValues (dotwpwa.js:4506)
at Object.LoadDFMValues (dotwpwa.js:25587)
at Object.CreateNewForm (dotwpwa.js:12383)
at Object.DoFormLoad (dotwpwa.js:12168)
at XMLHttpRequest.cb (dotwpwa.js:222)
In js file the error point to:
this.EnableColResize = function () {
var TableName = "";
var ResizeEnabled = false;
TableName = this.FName;
ResizeEnabled = this.FOptions.FResizeColumns;
if (!(4 in this.FComponentState)) {
resizableGrid(TableName, ResizeEnabled);
};
};
I cannot reproduce this.
Do you see this with our demo?
Steps to reproduce?
I see that on generated js file is only one place with
resizableGrid function definition, but this function is created by
AddControlScriptSource and function resizableGrid is not visible.
this.CreateElement = function () {
var Result = null;
Result = document.createElement("DIV");
this.FTable = null;
this.AddControlScriptSource("var
pageX,curCol,nxtCol,curColWidth,nxtColWidth,autoWidth,curTable,curTableWidth;"
+ "autoWidth = false;" + "function resizeColumn(e) {" + " if (curCol)
{" + " var diffX = e.pageX - pageX;" + "\t\tif ((nxtCol) &&
(!autoWidth)){" + '\t\t nxtCol.style.width = (nxtColWidth -
diffX)+"px";' + " } else {" + " }" + " newColWidth = (curColWidth +
diffX);" + " if (newColWidth < 10)" + " newColWidth = 10;" +
'\t curCol.style.width = newColWidth + "px";' + " }" + " }" +
"function resetResize() {" + " curCol = undefined;" + " nxtCol =
undefined;" + " pageX = undefined;" + " nxtColWidth = undefined;" +
" curColWidth = undefined;" + " curTable = undefined;" + "
curTableWidth = undefined;" + " }" + "function resizableGrid(tablename,
enabled) {" + ' var table = document.getElementById(tablename +
"Table");' + " if (!table) return;" + ' var row =
table.getElementsByTagName("tr")[0],' + " cols = row ? row.children :
undefined;" + " if (!cols) return;" + " for (var
i=0;i<cols.length;i++){" + ' var coldiv =
document.getElementById(tablename + "Div" + i);' + " if (coldiv)" +
" coldiv.remove();" + " if (enabled) {" + " var div =
createDiv();" + " cols
.appendChild(div);" + '
cols.style.position = "relative";' + ' div.id = tablename + "Div" +
i;' + " setListeners(div);" + " }" + " }" + " function
setListeners(div){" + ' div.addEventListener("mousedown", function (e)
{' + " curCol = e.target.parentElement;" + " nxtCol =
curCol.nextElementSibling;" + " pageX = e.pageX;" + " curColWidth =
curCol.offsetWidth;" + " curTable =
curCol.parentElement.parentElement.parentElement;" + " curTableWidth =
curTable.offsetWidth;" + " if (nxtCol)" + " nxtColWidth =
nxtCol.offsetWidth;" + " });" + ' div.addEventListener("mouseover",
function (e) {' + ' e.target.style.borderRight = "2px solid #0000ff";'
+ " });" + ' div.addEventListener("mouseout", function (e) {' + '
e.target.style.borderRight = "";' + " });" + '
document.addEventListener("mousemove", function (e) {' + "
resizeColumn(e);" + " });" + ' document.addEventListener("mouseup",
function (e) {' + " resetResize(e);" + " });" + " }" + " function
createDiv(){" + ' var div = document.createElement("div");' + "
div.style.top = 0;" + " div.style.right = 0;" + ' div.style.width =
"10px";' + ' div.style.position = "absolute";' + ' div.style.cursor =
"col-resize";' + ' div.style.userSelect = "none";' + '
div.style.height = "100%";' + ' div.innerHTML = " ";' + "
return div;" + " }" + "};");
return Result;
};
I will try reproduce it in my application but give me info when and for which kind of object function EnableColResize is running?
I prepared simple example program to reproduce this issue.
We fixed the issue. It was only under the circumstances of linking to a HTML template table.
We'll release an update asap.
If it can help, we can send an incremental source update to help you immediately. Contact us by email for this.
No problem I can wait ... but when do you plan update ... today or rather next week?
We aim for Feb 10 or Feb 11
ok I will wait to next week ... for me it isn't critical at the moment ... thank you for info
Hi Bruno, I ran in to the same issue and posted in XDATA forum as it happens when I try and generate a crud via the wizzard as well.
-scott
We plan to release an update today or tomorrow.