Combo Filter with link row

Hi,



My problem is very simple.

I got a datagrid with some combobox filter declared like this :



"

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

mygrid.setColTypes(“link,link”);

"



in my xml file, rows elements are declared with a javascript link like this :

"



BLP2.BA-58^javascript:alert(“toto”);^_self

DEFAUT^javascript:alert(“tutu”);^_self





BLP2.BA-58^javascript:alert(“titi”);^_self

DEFAUT^javascript:alert(“tata”);^_self



"



The values displayed in my combo filter are the whole line. => “BLP2.BA-58^javascript:alert(“toto”);^_self”

And I got two different values that differs only by the JS action.

How can I fix it ?

I’ve tried modify “dhtmlxgridcell.js” in the function “dhtmlXGridComboObject”, but no visible effect…

If someone have an answer, I will be really pleased !





Second point, when I forced the date format in my Grid (“mygrid.setDateFormat(“d-m-Y”);” --> A froggy again ! :slight_smile:, I’ve got a javascript error “object doesn’t support this method/property”. I’ve loaded every dhtmlx file I’ve found in order to locate the problem, but It doesn’t want to work…

Maybe someone will have an idea.



Thanks a lot for your help.



How can I fix it ?

The filtering uses getValue method of cell object to fetch cell data, so the problem can be resolved only by modification of getValue method of link excell , or by creating custom excell for similar purpose.
Sample of modified link excell attached

>> I’ve got a javascript error “object doesn’t support this method/property”.
The setDateFormat method defined in dhtmlgrid.js , so it not requires any additional js files ( but it exists only in pro version )
Which type of column you are using? In case of dhxCalendar format will look as
    grid.setDateFormat(“%d-%m-%Y”);

dhtmlx.com/docs/products/dhtmlxG … ormatcells

dhtmlxgrid_excell_link_mod.zip (954 Bytes)


>>Sample of modified link excell attached



–> It’s working fine ! Thanks a lot !



>>The setDateFormat method defined in dhtmlgrid.js , so it not requires any additional js files ( but it exists only in pro version )



–> I haven’t the pro version :frowning: that’s why the method doesn’t exist in my file !



Thanks again for your reactivity !


In case of dhxCalendar you can try next approach ( it not as stable as setDateFormat , but must work in most cases )
    grid._dtmask="%d-%m-%Y"
This command need to be called before loading data in grid.