Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Eben on Feb 27, 2008 12:56
open dhtmlx forum
sorting links

I have a column of linked values, and when sorting by the default "str", it sorts them by the actual html, which of course is not the desired result. I've read this link: http://dhtmlx.com/docs/products/dhtmlxGrid/samples/cell_types/link_grid.html?un=1196078486000

But it doesn't address my particular problem. The links in question respond to an onclick event and fire a javascript method, thus I don't want them to target _blank... Is there a way to sort these using ro,link, and not have it pop take any target action?
Answer posted by Support on Feb 28, 2008 02:20
There are two solutions

a) you still can use "link" excell and its native sorting capability, the target frame can be set as part of data
    <cell>Name^javascript:myfunc()^_self</cell>

such value will be rendered as link with javascript action as href, and because of self it will not triger any new window opening.

b) you can use custom sorting - it possible to defined custom routine which will compare values
    http://dhtmlx.com/docs/products/dhtmlxGrid/samples/rows_columns_manipulations/pro_sort.html?un=1204194864000
In you case custom sorting routine will receive full values of cell, including html tags, but may compare ( if properly coded ) only text parts of them.