I have a page whre I create a window attaching a grid.
I show this window in modal view but when I tab inside the gris wich is inside the window and I reach the last record I follows tabbing in the parent page.
How can I do to only tab inside the window and not continue tabbing in the page?
How can I close the window from the grid? I I put this event It checks the event key bay not follows tabbing.
grid.attachEvent(“onKeyPress”,function(){
if (window.event.keyCode==27) { // Escape
dhxWins.window(“w1”).close();
document.getElementById(‘cmb_receipt’).focus();
});
Thans a lot!
and not continue tabbing in the page?
You can define any possible target for the tab-out by
grid.setExternalTabOrder(obj,obj);
where obj - id or object of element, to which focus need to be moved from the grid.
>>How can I close the window from the grid?
You can use onTab event and check the current selected cell in grid, if it is the last cell - necessary action may be executed.
I have put the event a nd the tab order you suggested.
whe I click a button the window opens but tab goes to the first input into the parent not to the fist cell f the grid inside the window.
The tab event only tabs into the grid inside the window once. and the goes to first input into the parent.
I don’t know if the event is the problesm. Here is my code:
Functio for the button:
function buscar_Viajes(){
dhxWins.enableAutoViewport(false);
dhxWins.setViewport(0, 0, 1100, 800);
dhxWins.vp.style.border = “#909090 0px solid”;
w1 = dhxWins.createWindow(“w1”,80, 40, 425, 350);
// hiding button max, min y contraer
w1.button(“minmax1”).hide();
w1.button(“minmax2”).hide();
w1.button(“park”).hide();
//No permite
w1.denyResize(); // deny resizing
w1.denyMove(); // deny moving
w1.setText(“Seleccionar Viaje”);
w1.setModal(true);
var grid = w1.attachGrid();
grid.setEditable(true);
grid.setSkin(“light”);
//enable tooltips for last column
grid.enableTooltips(“false,false,false,false,false,false,false,true”);
grid.setExternalTabOrder(“bViajes”,“cmb_receipt”); // inputs in parent
//moverse entre las filas con el teclado
grid.enableKeyboardSupport(true);
//tabulacion
grid.enableEditTabOnly(1);
//seleccionar fila con dobleclick
grid.attachEvent(“onRowDblClicked”,doOnRowDblClickedV);
//ocultar si se pulsa escape
grid.attachEvent(“onTab”,function(){
var numRows = grid.getRowsNum();
var id = grid.getSelectedRowId();
var numRow = grid.getRowIndex(id);
if (numRows == numRow){
dhxWins.window(“w1”).close();
}
});
//solo se puede seleccionar uno
grid.enableMultiselect(false);
grid.loadXML(“buscarViaje.php”);
w1.setModal(true);
}