Posted February 03, 2016
I have another question.
A little background: My previous little script was wildly popular, and so now I'm getting my feet wet in making a full-blown extension.
My first extension's purpose is to lengthen our main viewing window of a table. The original table is regrettably tiny and doesn't use our window space.
Right now, when I go to the page, it lengthens the window correctly. However, after I reload some data (but not reloading the page) as selected from "ddlMyWorkOrderFilter", the view of the table shrinks back down to its default.
My solution to this was to make a function call to reformat the screen again every time ddlMyWorkOrderFilter changes. However, the function isn't calling. I've tried .onchange and addEventListener() to no avail. The function simply won't run. So I figure I'm missing some sort of fundamental issue.
I should note that the original code has an onchange event set to ddlMyWorkOrderFilter, so I also tried click and lose focus events to see if that was an issue.
Here's my extension's code thus far:
// This section makes the table bigger:
function reformatPage()
{
//changeFilter();
document.getElementById('tblWOWrapper').style.height= "500px";
document.getElementById('gview_tblWO').style.height= "480px";
document.getElementsByClassName('ui-jqgrid-bdiv')[0].style.height = "457px";
window.alert("reformatPage() executed");
}
//Remove logo
//document.getElementById('Image1').src = "";
//change size of text area when new filters are selected
//document.getElementById('ddlMyWorkOrderFilter').addEventListener=("change", reformatPage());
//document.getElementById('ddlMyWorkOrderFilter').onchange=reformatPage();
// Reformat the page the first time we get to it.
reformatPage();
Any ideas?
Thank you!!!
A little background: My previous little script was wildly popular, and so now I'm getting my feet wet in making a full-blown extension.
My first extension's purpose is to lengthen our main viewing window of a table. The original table is regrettably tiny and doesn't use our window space.
Right now, when I go to the page, it lengthens the window correctly. However, after I reload some data (but not reloading the page) as selected from "ddlMyWorkOrderFilter", the view of the table shrinks back down to its default.
My solution to this was to make a function call to reformat the screen again every time ddlMyWorkOrderFilter changes. However, the function isn't calling. I've tried .onchange and addEventListener() to no avail. The function simply won't run. So I figure I'm missing some sort of fundamental issue.
I should note that the original code has an onchange event set to ddlMyWorkOrderFilter, so I also tried click and lose focus events to see if that was an issue.
Here's my extension's code thus far:
// This section makes the table bigger:
function reformatPage()
{
//changeFilter();
document.getElementById('tblWOWrapper').style.height= "500px";
document.getElementById('gview_tblWO').style.height= "480px";
document.getElementsByClassName('ui-jqgrid-bdiv')[0].style.height = "457px";
window.alert("reformatPage() executed");
}
//Remove logo
//document.getElementById('Image1').src = "";
//change size of text area when new filters are selected
//document.getElementById('ddlMyWorkOrderFilter').addEventListener=("change", reformatPage());
//document.getElementById('ddlMyWorkOrderFilter').onchange=reformatPage();
// Reformat the page the first time we get to it.
reformatPage();
Thank you!!!