Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by pravu Mishra on Jul 27, 2009 10:47
open dhtmlx forum
missing search boxes

Hi,

1) I am using dhxLayout and 2U form
2) cell a of dhxLayout is a tree
3) cell b of dhxlayout is a Grid

When ever a click happens on a tree node, the following code gets executed

dhxLayout.cells("b")._frame.contentWindow.updateGrid("id="+id);

the updateGrid method contains code for receiving XML for loading into the Grid as mentioned below.

function updateGrid(id){

mygrid.loadXML("ecampusCourse_feed.jsp?action=get_data&"+id);

}

My grid uses header filtering and that is defined by using like the following code

mygrid.attachHeader(",,#text_filter,#combo_filter,#combo_filter,#combo_filter,

My problem is when ever the updateGrid() method gets called the header search boxes does not appear.

Can any body let me know where might be the problem.

Thanks and Regards,
Pravu Mishra.
Answer posted by dhxSupport on Jul 28, 2009 00:27
>>My problem is when ever the updateGrid() method gets called the header search boxes does not appear.
Please check if mygrid.loadXML("ecampusCourse_feed.jsp?action=get_data&"+id); does not retrun xml with <head></head> part which can override existent grid structure.
To update grid rows you should clear all rows and then load new row without grid configuration:
function updateGrid(id){ 
mygrid.clearAll();
mygrid.loadXML("ecampusCourse_feed.jsp?action=get_data&"+id); 
}

Answer posted by Pravu Mishra on Jul 28, 2009 03:46

Hi,

I do not know why the option you have provided is not working? it means the following code you have mentioned to use and it's not working.

function updateGrid(id){ 
mygrid.clearAll();
mygrid.loadXML("ecampusCourse_feed.jsp?action=get_data&"+id); 
}

I also checked the xml data. It has <head></head>

I use the following JS file and there is no JS error.

 

What are the other places I should check.

<script>_css_prefix="js/codebase/"; _js_prefix="js/codebase/"; </script> 
  <link rel="STYLESHEET" type="text/css" href="css/dhtmlxgrid.css">
  <link rel="STYLESHEET" type="text/css" href="css/dhtmlxgrid_skins.css">
  <link rel="STYLESHEET" type="text/css" href="css/dhtmlxcalendar.css">
  <link rel="STYLESHEET" type="text/css" href="css/dhtmlxgrid_pgn_bricks.css">
  <link rel="STYLESHEET" type="text/css" href="css/dhtmlxcombo.css">
  <script src="js/dhtmlxcommon.js"></script>
  <script src="js/dhtmlxgrid.js"></script>
  <script src="js/dhtmlxgridcell.js"></script>
  <script src="js/dhtmlxcalendar.js"></script> 
  <script src="js/dhtmlxgrid_excell_dhxcalendar.js"></script>
  <script src="js/dhtmlxgrid_srnd.js"></script>
  <script src="js/dhtmlxgrid_filter.js"></script>
  <script src="js/dhtmlxdataprocessor.js"></script>
  <script src="js/dhtmlxgrid_pgn.js"></script>
  <script src="js/dhtmlxcombo.js" type="text/javascript"></script>
  <script src="js/dhtmlxgrid_excell_combo.js" type="text/javascript"></script>
  <script src="js/dhtmlxgrid_undo.js"></script>
  <script src="js/dhtmlxgrid_splt.js"></script>
  <script src="js/validations.js"></script>

Thansk and Regards,

 

 

Answer posted by Pravu Mishra on Jul 28, 2009 04:00

 

This following updateGrid method works ok.

  function updateGrid(id){
   mygrid = new dhtmlXGridObject('gridbox');
   mygrid.setImagePath("js/codebase/imgs/");
   mygrid.attachHeader(",,#text_filter,#combo_filter,#combo_filter,#combo_filter,#select_filter,#text_filter,#text_filter,#text_filter,#text_filter,,");
   mygrid.enablePaging(true,15,5,"pagingArea",true,"recinfoArea");

   mygrid.attachEvent("onXLS",function(){
     document.getElementById('cover').style.display='block';
   });
   mygrid.attachEvent("onXLE",function(){
    document.getElementById('cover').style.display='none';
   });

   mygrid.loadXML("ecampusCourse_feed.jsp?action=get_data&"+id);
   mygrid.init();
   mygrid.setPagingSkin("bricks");
   
   mygrid.setSkin("light"); //light, gray, mt,xp, modern,clear

   mygrid.setColumnHidden(0,true);
   mygrid.setDateFormat("%d/%m/%Y");

   myDataProcessor = new dataProcessor("ecampusCourse_feed.jsp?action=data&"+id);
   myDataProcessor.setUpdateMode("off");
    myDataProcessor.enableDebug(true);
   myDataProcessor.setVerificator(1,isBlank);
   myDataProcessor.setVerificator(2,isBlank);
   myDataProcessor.setVerificator(3,isBlank);
   myDataProcessor.setVerificator(4,isBlank);
   myDataProcessor.setVerificator(5,isBlank);

   myDataProcessor.setVerificator(8,isNumeric);
   myDataProcessor.setVerificator(9,isNumeric);
   myDataProcessor.setVerificator(10,isBlank);
   myDataProcessor.init(mygrid);

   }

There is another method like the following and it gets executed on page load.

function doOnLoad(){

mygrid = new dhtmlXGridObject('gridbox');

....

......

}

But instead of using the above updateGrid(id) method if I use the following method

function updateGrid(id){ 
mygrid.clearAll();
mygrid.loadXML("ecampusCourse_feed.jsp?action=get_data&"+id); 
}

I get  problems in the combo values. Hidden combo values gets displayed.

Please Help.....

Thanks and Regards,

 

 

 

Answer posted by dhxSupport on Jul 28, 2009 05:23
>>I also checked the xml data. It has <head></head>
After first loading your xml response should has <head></head> part
While updating grid your xml responce should not has <head></head> part as grid structure is already defined
Answer posted by Pravu Mishra on Jul 28, 2009 06:38

Please find attached a jar file that contains all my code and xml data file and rename it to zip to open by WinZip.

My problem and Observations

My application uses a tree in the left hand side of the window and in the right hand side a grid appears. “courseLayout.html” is the main html and it brings the application and loads “course2.xml” in the grid by default.

Whenever the tree get a click,  another xml gets loaded in the grid.

There are three xml data files included in the zip file for grid and those are course.xml, course2.xml, courseWithoutheader.xml .

1.      Create grid and load xml onto grid on page load. If the same data file is getting used while updating then it does not create any problem. It means if the same xml is getting used while clicking on tree item then it does not create any problem. Following is my update method.

              function updateGrid(id){

                           mygrid.clearAll(true);

                           //mygrid.loadXML("courseWithoutheader.xml");

                           //mygrid.loadXML("course.xml");

                           mygrid.loadXML("course2.xml");

                            mygrid.attachHeader(",,#text_filter,#combo_filter,#combo_filter,#combo_filter,#select_filter,#text_filter,#text_filter,#text_filter,#text_filter,,");

                           mygrid.setSizes();

                     }

2.       If any other xml gets used while updating grid the combo values does not appear correct.

3.      If an xml without having header us used while updating grid then combo values does not appear correct and header does not appear.

Thanks and Regards,

 


 

Attachments (1)
Answer posted by dhxSupport on Jul 28, 2009 08:38
Answer was send you by email