Re: How to Place Button on Bottom of GRID
I have added a button just like in the video that calls a javascript function 'AddNewRecord()'. I have tested it with an alert message and it works OK.
What I want to do is open a grid component just as I would in the onclick event of a button inserted in the grid.
I have copied the code from a button that I inserted just to get the code and pasted it into the function but nothing happens.
Anyone have an idea of what I would have to change to make it work. I'm guessing that the object names need to be changed. But to what?
Below is the code from the action javascript in a button I created to capture the code. Inserted into the JavaScript function declarations. I don't get any errors just nothing happens?
function AddNewRecord {
{grid.componentName}_G__UNBOUND_BUTTON_1_1({grid.rownumber},'{grid.rowId}',this);
window['{grid.componentName}_G__UNBOUND_BUTTON_1_1'] = function(rowNum,rowId,objEle) {
var windowName = 'WINDOW_2953303d_a233_405f_98b0_4ec157d4e8a8';
var currWindow = {Grid.object}.getWindow(windowName);
var go = new Object();
go.objectId = objEle.id;
go.gridName = 'brapvendadd';
go.alias = '{Grid.componentname}_brapvendad_pdyu';
go.submitCurrentFieldValues = true;
go.sourceGridPart = 'G';
go.sourceGridRowNumber = rowNum;
go.workingMessage = '<img src=\'CSS/A5System/images/wait.gif\' />Working...';
go.userFilter = '';
go.baseFilter = '';
go.arguments = '';
go.linkDefinition = '';
go.placeHolderValues = '';
go.userOrder = '';
go._thisGridAlias = {grid.object}.gridId;
go._gridCurrentFilter = {grid.object}._gridFilter;
go._gridCurrentOrder = {grid.object}._gridOrder;
go._gridCurrentArguments = {grid.object}._gridArguments;
go._gridCurrentDBType = {grid.object}._gridDBType;
go.overrideSettings = 'Style_name = `{Grid.style}`';
go.a5_default_path = '{grid.defaultPath}';
go.flagTimer = 'F';
go.flagQueryEcho = 'F';
go.flagDebugMode = 'F';
go.windowName = windowName;
if(!currWindow) {
currWindow = {Grid.object}.createWindow(windowName,'modal-resizable',
{body: {content: {type: 'blank',
elementId: '~'}},
height: '5in',
width: '8in',
title: {html: 'Window'},
onHide: function() {{grid.object}.refreshRow({Grid.object}._focusRow);}}
);
go.gridDiv = currWindow.getWindowId('body');
{grid.Object}.openChildGrid(go);
currWindow.show();
} else {
ele = '{Grid.componentname}_brapvendad_pdyu.GRID_PART.FORM_CONTAINER_DIV';
pele = $(ele);
pele.innerHTML = '<img src=\'CSS/A5System/images/wait.gif\' /> Working...';
go.gridDiv = currWindow.getWindowId('body');
go.parentGridId = '{grid.componentname}';
window['{GRID.COMPONENTNAME}_BRAPVENDAD_PDYU_GridObj'].synchronizeGrid(go);
};
};
}
I have added a button just like in the video that calls a javascript function 'AddNewRecord()'. I have tested it with an alert message and it works OK.
What I want to do is open a grid component just as I would in the onclick event of a button inserted in the grid.
I have copied the code from a button that I inserted just to get the code and pasted it into the function but nothing happens.
Anyone have an idea of what I would have to change to make it work. I'm guessing that the object names need to be changed. But to what?
Below is the code from the action javascript in a button I created to capture the code. Inserted into the JavaScript function declarations. I don't get any errors just nothing happens?
function AddNewRecord {
{grid.componentName}_G__UNBOUND_BUTTON_1_1({grid.rownumber},'{grid.rowId}',this);
window['{grid.componentName}_G__UNBOUND_BUTTON_1_1'] = function(rowNum,rowId,objEle) {
var windowName = 'WINDOW_2953303d_a233_405f_98b0_4ec157d4e8a8';
var currWindow = {Grid.object}.getWindow(windowName);
var go = new Object();
go.objectId = objEle.id;
go.gridName = 'brapvendadd';
go.alias = '{Grid.componentname}_brapvendad_pdyu';
go.submitCurrentFieldValues = true;
go.sourceGridPart = 'G';
go.sourceGridRowNumber = rowNum;
go.workingMessage = '<img src=\'CSS/A5System/images/wait.gif\' />Working...';
go.userFilter = '';
go.baseFilter = '';
go.arguments = '';
go.linkDefinition = '';
go.placeHolderValues = '';
go.userOrder = '';
go._thisGridAlias = {grid.object}.gridId;
go._gridCurrentFilter = {grid.object}._gridFilter;
go._gridCurrentOrder = {grid.object}._gridOrder;
go._gridCurrentArguments = {grid.object}._gridArguments;
go._gridCurrentDBType = {grid.object}._gridDBType;
go.overrideSettings = 'Style_name = `{Grid.style}`';
go.a5_default_path = '{grid.defaultPath}';
go.flagTimer = 'F';
go.flagQueryEcho = 'F';
go.flagDebugMode = 'F';
go.windowName = windowName;
if(!currWindow) {
currWindow = {Grid.object}.createWindow(windowName,'modal-resizable',
{body: {content: {type: 'blank',
elementId: '~'}},
height: '5in',
width: '8in',
title: {html: 'Window'},
onHide: function() {{grid.object}.refreshRow({Grid.object}._focusRow);}}
);
go.gridDiv = currWindow.getWindowId('body');
{grid.Object}.openChildGrid(go);
currWindow.show();
} else {
ele = '{Grid.componentname}_brapvendad_pdyu.GRID_PART.FORM_CONTAINER_DIV';
pele = $(ele);
pele.innerHTML = '<img src=\'CSS/A5System/images/wait.gif\' /> Working...';
go.gridDiv = currWindow.getWindowId('body');
go.parentGridId = '{grid.componentname}';
window['{GRID.COMPONENTNAME}_BRAPVENDAD_PDYU_GridObj'].synchronizeGrid(go);
};
};
}
Comment