inner vertical gridscrollbars wanted

Hey,

I have converted my html table to a grid by adding dhtmlxGrid class (no problem with that),
my html table exists in a div container with a predefined width and height,
the data in html table (grid) is big so i want my grid to show me vertical scroll bars automatically

i don’t want exetrnal scroll bars (that means i don’t want the container scroll bars)

i tried this methods
grid1.enableAutoWidth(true);
grid1.enableAutoHeight(true);
grid1.setSizes();
grid1.setSizes();

but no success

is there a way to do this

thanks

No way

Auto-width and auto-height methods do the exactly opposite - they size grid to not show inner scrolls.

If you are initializing grid from html

  • remove auto width and auto height commands
  • add to source html table
<table gridWidth="600px" gridHeight="200px" ...

sizes defined in such way will be applied to the newly created dhtmlxgrid, and if necessary it will produce an inner scrolls.

Thanks for your reply, i don’t have that problem anymore because i’ve used xml load to my grid.
but i have another problem now. keyboard navigation (up and down) is not working for me, plus the grid is not activated after loading

I’m using this good

var telefonGrid;
	var telefonGridQString;
	
	telefonGrid = new dhtmlXGridObject('telefonData');
	telefonGrid.setImagePath("../../imgs/");
	telefonGrid.setHeader("Anrede, Name, Funktion, Gruppe");
	telefonGrid.setInitWidths("100, 100, 100, 100"); 
	telefonGrid.setColTypes("ro,ro,ro,ro");
	telefonGrid.enableKeyboardSupport(true); 
	
	telefonGrid.init();
	telefonGrid.setSkin("dhx_skyblue");
	
	telefonGridQString = "/moffice/moffice2012/controller/adressen/getTelRecords.php"
	telefonGrid.loadXML(telefonGridQString, function(){telefonGrid.selectRow(0); telefonGrid.setActive(true);});
	
	telefonGrid.init();
	telefonGrid.setSkin("dhx_skyblue");
	
	
	telefonGridQString = "/moffice/moffice2012/controller/adressen/getTelRecords.php"
	telefonGrid.loadXML(telefonGridQString, function(){telefonGrid.selectRow(0); telefonGrid.setActive(true);});

I have forgotten to add one detail, the grid exists in dhtmlx window, this window itself is loaded by attaching to another dhtmlx window.

any ideas please

Unfortunately the issue cannot be reconstructed locally.
Please, have a look at the working example:
dhtmlx.com/docs/products/dht … _grid.html

If issue still occurs - please, provide a complete demo where the issue can be reconstructed.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/doku.php?id=othe … leted_demo

it’s a good example but i have the grid with other elements (labels, buttons, inputs)

the problem is not an dhtmlx problem because the same code is working with another table (in mysql) once I change , it doesn’t work, that means the same js/php code work with one table and doesn’t work with another, it’s very wierd!!!

If issue still occurs - please, provide a complete demo to reconstruct it.

Thanks for your answer!
As I said before the problem is not dhtmlx problem,
as I said i have used XML to feed my grid, and in the attribute ID in the XML structure takes the ID of my (the primary key of mysql table) but after two days of looking for the reason why it doesnt work I have discovered finaly that the field that I put as an ID for my grid is not primary key, so it’s not a true ID. so that’s why navigation with key board (up and down) wasn’t working

But now I have another problem again the grid is not focused (activated) after loading data,
and this is the code I’m using for that.

telefonGrid.loadXML(telefonGridQString, function(){telefonGrid.selectRow(0);
telefonGrid.setActive(true);
telefonGrid.selectCell(0,0,0,0,1);});

As far as I can see, there is no any reason why grid can’t be non-active after such actions.
Is issue occurs only in IE or in all browsers?

In all browsers (FireFox, chrome, opera, safari), Here is the complete scenario:

First from a dhtmlx window(adressen) I show telefon window like this

			function showTelefonFromAdressen()
			{
				win = dhxWinAdressen.createWindow("wins_adressen", 0, 10, 900, windowsHeight - 70);
				win.setText("Telefon");
				win.setModal(true);
				
				dhxWinAdressen.window("wins_adressen").denyResize();
				
			    dhxWinAdressen.window('wins_adressen').button("park").hide();
				dhxWinAdressen.window('wins_adressen').button("minmax1").hide();
				dhxWinAdressen.window('wins_adressen').button("close").hide();
					
				dhxWinAdressen.window("wins_adressen").attachURL("/moffice/moffice2012/view/adressen/telefon.html");
				
			}

next on the load of telefon window, i fill my grid with data

		function doOnTelLoad()
		{
			
			telefonGrid = new dhtmlXGridObject('telefonData');
			telefonGrid.setImagePath("../../codebase/imgs/");
			telefonGrid.setHeader("Anrede, Name, Funktion, Guppe, Telefon-NR, Mobil, Fax, Mail");
			telefonGrid.setInitWidths("100, 100, 100, 100, 100, 100, 100, 100");
			telefonGrid.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro");
			telefonGrid.enableCellIds(true);
			telefonGrid.attachEvent("onRowSelect", doOnRowSelected);
			telefonGrid.init();
			telefonGrid.setSkin("dhx_skyblue");
			telefonGridQString = "/moffice/moffice2012/controller/adressen/getTelRecords.php";
			
			telefonGrid.loadXML(telefonGridQString, function(){
			      	telefonGrid.selectRow(0);
                                telefonGrid.setActive(true);
                                telefonGrid.selectCell(0,0,0,0,1); 
			});
		}

It’s true that the first row is selected but the grid is not active ( the whole window is not active), to make the window active i need one more click inside it, and to active to grid I need to click on any row (after that click keyboard navigation works), I just don’t want that extra click.

I hope you understand me.

Are you using some other components on page, especially dhtmlxCombo or dhtmlxTree ?

After executing setActive, grid will try to handle all key events, but if focus is stolen by some other UI control, key events will never rich grid.

You can try to use the attached dhtmlxgrid.js instead of the original one, it has fix for the similar issue in IE9, may help for problem in your case as well.
dhtmlxgrid.compressed.zip (27.4 KB)

Hi Stanislav, i appreciate your help, but unfortunately, i’m still stack here,

I have made a demo, the first row is selected but the grid is not active( the whole window is not active)

I tried dhtmxlgrid you’ve attached but no success!
complete_demo.rar (68.7 KB)

Problem caused by multi-frame nature of the page.

You can add one more line

window.focus();
mygrid.setActive(true); //<= this is it

It will move focus to the frame in question.

Hi Stanislav,

it works perfectly,

Thank you so much