Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tejas on Sep 07, 2009 05:59
open dhtmlx forum
:: DHX Grid :: Combo not positioning properly when grid scrolled.

Hi there,

The grid combobox is not getting positioned properly.
Video: http://www.4shared.com/file/130851883/8edd53c2/Grid_Combo_Positioning.html

I am using DHX Version: dhtmlxSuite 2009 Rel.1 (DHTMLX 2.1) Professional edition build 90226/90316
DHX Grid Version: dhtmlxGrid v.2.1 Professional edition build 90316

Following is the JS code:

function int_custom(a,b,ord)
            {
                         a=a.toString().replace(/<[^>]*>/g,"")*1;
                         b=b.toString().replace(/<[^>]*>/g,"")*1;
                         return (a>b?1:-1)*(ord=="asc"?1:-1);
            }

            userVariablegrid = new dhtmlXGridObject('userVariableGrid_container');
            
            userVariablegrid.attachEvent("onXLS",function()
            {
    
     $('userVariableGridLoadinDiv').show();
    
     });
userVariablegrid.attachEvent("onXLE",function()
{
     //showing the grid div and paging div after the grid xml loads succesfully
     $('userVariableGridLoadinDiv').hide();
     $('pagingDiv').show();
    
     });
            userVariablegrid.setImagePath(Gpath+"/js/dhtmlx/dhtmlxGrid/codebase/imgs/");
            userVariablegrid.setSkin("light");
            userVariablegrid.enableTooltips("false,false,false,false,false");    
            userVariablegrid.enableRowsHover(true,'grid_hover');
            userVariablegrid.enableResizing("false,false,false,false,false");
            userVariablegrid.enablePaging(true,<s:property value="${defaultGridRows}" />,<s:property value="${defaultNoOfPages}" />,"pagingAreaUVS",true,"recinfoAreaUVS"); // This line is for simple paging, where pagingArea and recinfoArea are div Ids.
            
            /*Changes for Grid Paging Issues, By Tejas, 10/Jul/2008 : S*/
            /* Updates: To resolve the Browser Resolution Compatibility Issue; By: Tejas; Date: 18/Aug/2009: S */
            var actualHeight = getFlexibleGridHeight(340);
            userVariablegrid.enableAutoHeight(true,actualHeight,true);
            /* Updates: To resolve the Browser Resolution Compatibility Issue; By: Tejas; Date: 18/Aug/2009: E */
            userVariablegrid.objBox.style.overflowX="hidden";
            /*Changes for Grid Paging Issues, By Tejas, 10/Jul/2008 : E*/
            
            /*Changes to display no. of pages from XML & Paging Customization By : Tejas, Date : 28/Jul/2008 : S*/
         userVariablegrid.setPagingTemplates("<div class='flexiDiv'><b>Results Total [total]</b></div> <div class='flexiDiv' id='paging_first' onclick='userVariablegrid.changePage(1);' style='cursor:pointer; color:black; padding:0px 3px;' title='Click here to go to the first page'><<</div> <div class='flexiDiv' style='padding-right:3px'><b>[prevpages:Previous "+defaultNoOfPages+": ]</b></div><div class='flexiDiv'> [currentpages:]</div><div class='flexiDiv'><b> [nextpages:Next "+defaultNoOfPages+": ]</b></div><div class='flexiDiv' id='paging_last' onclick='userVariablegrid.changePage(9999);' style='cursor:pointer; padding-left:3px; color:black;' title='Click here to go to the last page'>>></div> ","");
            /*Changes to display no. of pages from XML & Paging Customization By : Tejas, Date : 28/Jul/2008 : E*/
            
            
            userVariablegrid.attachEvent("onAfterSorting",function(ind){
                
                 showCustomizedPaging(userVariablegrid, <s:property value="${defaultGridRows}" />);
                 });
                
                 userVariablegrid.attachEvent("onEditCell",function(editStage,rowId,cellIndex,newValue,oldVal){
                     
                     
                 checkEdUserVarGrid=onUserVarCellEdit(editStage,rowId,cellIndex,newValue,oldVal)
                 return checkEdUserVarGrid;
                
                 });
                
                    
            showCustomizedPaging(userVariablegrid, <s:property value="${defaultGridRows}" />);
            
            /* Updates: Enabling Multiline when page changed; By: Tejas; Date: 16/Jan/2009: S */
                userVariablegrid.attachEvent("onPageChanged",function(currentPageIndex,firstRowIndex,lastRowIndex){
                            
                        userVariablegrid.setSizes();
             });
            /* Updates: Enabling Multiline when page changed; By: Tejas; Date: 16/Jan/2009: E */
            
            
            userVariablegrid.attachHeader("#text_filter,#text_filter,#select_filter,,#select_filter,");
            userVariablegrid.init();
            
            userVariablegrid.attachEvent("onCalendarShow",function(cal,id,ind){
                        cal.options.isYearEditable = true;
                        cal.options.isMonthEditable = true;
                        
                        var pos = userVariablegrid.getPosition(userVariablegrid.cells(id,ind).cell);
                        cal.setPosition(pos[1]-175,pos[0]);
            });
            
            userVariablegrid.loadXML(Gpath+"/getUserVariableGrid.action");
            
            

Please help.
Answer posted by dhxSupport on Sep 07, 2009 06:42
What version of dhtmlxGrid do you use? Please try to update your version to the latest 2.5 version http://dhtmlx.com/docs/download.shtml
Answer posted by Tejas on Sep 07, 2009 21:29
I am using DHX Grid Version: dhtmlxGrid v.2.1 Professional edition build 90316.
and which which files I need to replace of v2.5 beta ?
Answer posted by Alex (support) on Sep 08, 2009 03:41

Hello, 

dropdown editors are absolutely positioned and position doesn't change when grid is scrolled. You can set onScroll event hanlder which stops editing (closes editor):

grid.attachEvent("onScroll",function(scrollLeft,scrollTop){

grid.editStop();

})

Answer posted by Tejas on Sep 08, 2009 07:51
Hi there,

No this is not the problem. You are getting it wrong.
When I double click the cell to select value from combobox, it shows it below cell as expected. I select it and the combo gets closed.
BUT when I scroll down to some other record and I double click the cell to select value from combobox, the combobox is shown much much below.

Please help.

Answer posted by Alex (support) on Sep 08, 2009 08:24

Please, try to use the latest 2.5 version. Here position calculation was improved. 

If you want to use 2.1, you can try to update only 

- for "co" cell type: dhtmlxgrid.js and dhtmlxcommon.js

- for "combo" cell type: dhtmlxcombo.js and dhtmlxcommon.js

Please, let us know if the issue is fixed. So, we can create the special patch for 2.1 version based on the 2.5 modifications

Answer posted by Tejas on Sep 08, 2009 23:15
Hi there,

Actually the JS files that I have also have some patches copied into these files.
I am attaching the dhtmlxgrid.js and dhtmlxcommon.js
Please insert necessary updates in these files as I can't completely replace these files as project is in production.
Please co-ordinate. Thanks!!!
Answer posted by Alex (support) on Sep 09, 2009 01:18

Hello, 

you didn't answer if the 2.5 version solved the problem. But we have included the necessary modifications in the provided files. They are attached.

Attachments (1)
updated.ZIP45.59 Kb
Answer posted by Tejas on Sep 09, 2009 03:33
Hi there,

It is not working :(
Will it work for coro also ?

Answer posted by Tejas on Sep 15, 2009 01:51
Hi there,

Please help me in this.
The combo box is getting dislocated only when we scroll down. Any idea ?
Answer posted by Alex (support) on Sep 15, 2009 07:28

Hello, 

please provide the complete demo to recreate the issue

Answer posted by Tejas on Sep 16, 2009 06:32
Hi there,

I already provided you the whole code in the previous post, but what according to you could be the reason for such behavior ?
Answer posted by Alex (support) on Sep 16, 2009 09:00

Hello,

the code that you have provided isn't complete demo http://www.dhtmlx.com/docs/support/what_is_a_completed_demo.htm

Could you please provide a ready sample to reproduce the issue. Locally the issue isn't recreated

Answer posted by Tejas on Sep 21, 2009 03:39
Hi there,

I have attached the working demo.
Waiting for your positive reply.
Attachments (1)
Answer posted by Alex (support) on Sep 21, 2009 09:54

Hello, 

the issue is confimed. Please, try to use attached fiels instead of originals. Locally the issue is solved with them

Attachments (1)
files.zip51.03 Kb
Answer posted by Tejas on Sep 22, 2009 03:05
Hi there,

I guess its not working with the attached files. Can you send me the example that I sent with your base files in it ???

Answer posted by Blagoj on Sep 22, 2009 05:29
Hi there!
I also have the same problem with combos in the grid but only on IE 8.
So if you have this problem only on this browser,use this at the beginning of your html file
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Answer posted by Tejas on Sep 22, 2009 05:36
Hi there Blagoj,

Thanks for the advice, but we are told not to use such meta tag.
DHX Support, Waiting for your reply.
Answer posted by Alex (support) on Sep 22, 2009 09:29

Hello,

the sample is attached

Attachments (1)