If so, I wouldn't use pui.set, I'd use applyProperty, like this:
Code: Select all
applyProperty("btnExpand", "value", "F8 - Close");
applyProperty("btnExpand", "icon", "up arrow");
Code: Select all
applyProperty("btnExpand", "value", "F8 - Close");
applyProperty("btnExpand", "icon", "up arrow");
Code: Select all
var grid = getObj("ACTMVTRS").grid; // get pointer to grid object
grid.toggle(); // toggle the grid rows open or closed
if (grid.expanded) // if grid now expanded
{
applyProperty("btnExpand", "value", "F8 - Close");
applyProperty("btnExpand", "icon", "up arrow");
}
else // else, grid is collapsed
{
applyProperty("btnExpand", "value", "F8 - Open");
applyProperty("btnExpand", "icon", "down arrow");
}
Code: Select all
applyProperty("btnExpand", "field type", "css button");
mpilo0, I tried your suggestion and that is not working, either. I created two hidden text boxes and bound their "value" property each to the same RPG fields as the button in question. Then I set their value instead the button properties and do the redraw just for good measure. No dice.mpilo0 wrote:I've had the same problem on other properties I wanted to set in Javascript. The best way that i have found to do this is to simply add a hidden textbox/checkbox to your screen where you store the value giving the textbox/checkbox the same binding field as the property.
Code: Select all
var grid = getObj("ACTMVTRS").grid; // get pointer to grid object
grid.toggle(); // toggle the grid rows open or closed
if (grid.expanded === true) // if grid now expanded
{
//applyProperty("btnExpand", "value", "F8 - Close");
//applyProperty("btnExpand", "icon", "up arrow");
pui.set("txtF8FOLDTEXT", 'F8 - Close');
pui.set("txtF8FOLDICON", 'up arow');
}
else // else, grid is collapsed
{
//applyProperty("btnExpand", "value", "F8 - Open");
//applyProperty("btnExpand", "icon", "down arrow");
pui.set("txtF8FOLDTEXT", 'F8 - Open');
pui.set("txtF8FOLDICON", 'down arow');
}
applyProperty("btnExpand", "field type", "css button"); // redraw
I did a copy-n-paste from the id field of the button into the JavaScript code for the onclick event of that same button. Still not working.Scott Klement wrote:Hmmm... I set up a test case, and it works fine for me.
Please make sure you are using the button's "id" property on the applyProperty() call (not the bound field name). Also, it's case-sensitive, so be sure the upper/lower case matches exactly.
Code: Select all
window.WISEsfl_Expanded = (pui.get('txtExpanded') == 'true');
Code: Select all
var obj = getObj("ACTMVTRS").grid; // get pointer to grid object
if (window.WISEsfl_Expanded === true) // if grid is expanded
{
obj.collapse(); // then collapse the grid rows
window.WISEsfl_Expanded = false; // reverse my internal flag
applyProperty("btnExpand", "value", "F8 - Open");
applyProperty("btnExpand", "icon", "down arrow");
}
else // else, grid is collapsed
{
obj.expand(); // so expand the grid rows
window.WISEsfl_Expanded = true; // reverse my internal flag
applyProperty("btnExpand", "value", "F8 - Close");
applyProperty("btnExpand", "icon", "up arrow");
}
Users browsing this forum: No registered users and 1 guest