Categories | Question details Back To List | ||
column hide/unhide and sort order I'd like to know how I can capture 2 things... (1) a user hiding/unhiding event and identify the column name or index. (2) I'd also like to identify the sort column index and sort order. Can you please provide a sample in both the events and if possible, can I capture this information through the serialized xml. I want to be able to identify the user's preferred settings to reload them for the user's next session. this is what I have to identify column sorting... but how do I identify the sort order (asc, desc) ? ? ? grid.attachEvent("onAfterSorting", function(ind) { alert(ind); }); Thx in advance Answer posted by Support on Aug 26, 2008 01:34 >> a user hiding/unhiding event and identify the column name or index >>but how do I identify the sort order (asc, desc) ? ? ? Answer posted by David on Aug 26, 2008 09:16 >> a user hiding/unhiding event and identify the column name or index >>>>I'm not pretty sure which action you have mean, the grid has not any special hiding related event When grid.enableHeaderMenu(); is used, right-clicking on the header menu allows you to hide/unhide columns. I want to be able to identify the "visible" columns such that I can display ONLY the visible columns on user's next session. Perhaps an enhancement would be to include a "visible" attribute in the <column> tag ? Also, a "sortorder" attribute in the <column> tag would be helpful as well. thx for the onAfterSorting code snippet. Answer posted by Support on Aug 26, 2008 09:26 Starting from dhtmlxgrid 1.6 column@visible attribute can be used to define hidden columns from XML ( this parameter not included in serialization ) - the support of this feature is still experimental >>When grid.enableHeaderMenu(); is used, right-clicking on the header menu allows you to hide/unhide columns. Unfortunately there is no separate event to catch such action in current version. The issue can be workarounded in two ways a) adding custom event to exisitng code b) using inner collection grid._hrrar , it is an array which contain flags for hidden columns (!!grid._hrrar[index]) - flag for column at "index" Answer posted by David on Aug 26, 2008 09:59 I think I found another "work around." I find that the width is equal to zero if the column is hidden in the serialized xml. Is this a safe assumption ? Answer posted by Support on Aug 27, 2008 01:28 >> Is this a safe assumption ? The width of hidden column is always equal to 0, but if column resize enabled user can resize column to 0 as well. There is a buitl in method to check the state of column grid.isColumnHidden(index) |