Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by GaK on May 20, 2008 08:50
open dhtmlx forum
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 :
"
<row id="1">
<cell>BLP2.BA-58^javascript:alert("toto");^_self</cell>
<cell>DEFAUT^javascript:alert("tutu");^_self</cell>
</row>
<row id="1">
<cell>BLP2.BA-58^javascript:alert("titi");^_self</cell>
<cell>DEFAUT^javascript:alert("tata");^_self</cell>
</row>
"

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 ! :), 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.

Answer posted by Support on May 20, 2008 09:45
>>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");

http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Cell_values_formating.html#grid_art_formatcells
Attachments (1)
Answer posted by GaK on May 22, 2008 00:09

>>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 :( that's why the method doesn't exist in my file !

Thanks again for your reactivity !

Answer posted by Support on May 22, 2008 02:48
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.