Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Stefan Riedel-Seifert on Jan 04, 2010 02:43
open dhtmlx forum
Grid - Column moving with attached complex header filters

Hello,

as i found in the knowledge base, colum moving is not possible with attached filters, if not all columns have filters attached, because of rowspan.

If i am attaching filters to all columns, column moving works fine.

Unfortunately not in every situation filters make sense. My idea was, to attach filters to every column, but for
a couple of columns i want to hide the filters via css+jquery.

But in firebug, i've seen, that the filters field have no id or class attached.

Is it possible to have this?

Best regards, Stefan
Answer posted by dhxSupport on Jan 04, 2010 03:25
You can set id for the filter in header with following code:
var filter=mygrid.getFilterElement(COLUMN_INDEX);//reference to the filter html object
filter.id="some id";
Answer posted by Stefan Riedel-Seifert on Jan 04, 2010 04:58

Hello,

 

this works fine. Is it possible to replace the select filter box with the combo.box-control?

 

Best regards,

Stefan

Answer posted by Stefan Riedel-Seifert on Jan 04, 2010 05:26

sorry, i found the combobox example in the samples.

When using

 

<script>
 mygrid = new dhtmlXGridObject('gridbox');

 mygrid.setImagePath("../js/codebase/imgs/");
 mygrid.setHeader("Serial No,Tag No,Project No,Order No,Position");
 mygrid.attachHeader("#text_search,#text_search,#select_filter,#text_search,#text_search");
 mygrid.setInitWidths("130,130,130,82,100")
 mygrid.enableAutoWidth(true);
mygrid.enableAutoHeight(true);
 mygrid.setColAlign("left,left,left,left,left")
 mygrid.setColTypes("ro,ro,ro,ro,ro");
    mygrid.getCombo(5).put(2,2);
   mygrid.setColSorting("int,str,str,int,str")
 mygrid.setSkin("euh_standard");

mygrid.enableMultiselect(true);
mygrid.attachEvent("onBeforeCMove", function(a, b) {
    return confirm("Allow move column " + a + " to position " + b);
});

 

 mygrid.init();
var filterObject=mygrid.getFilterElement(0);
 
 mygrid.enableSmartRendering(true);


 

 

    mygrid.loadXML("500.xml");
 
</script>

 

i will get an javascript error: filterObject unknown. What is wrong here?

 

Best regards,
Stefan

Answer posted by Alex (support) on Jan 12, 2010 08:31

text_search input can not be got by getFilterElement method. 

You can try to use the following approach instead: grid.hdr.rows[2].cells[COLUMN_INDEX].getElementsByTagName("INPUT")[0]

var filterObject = mygrid.hdr.rows[2].cells[0].getElementsByTagName("INPUT")[0];