I know what you mean but people seem to do it regardless. It's more of a preference but there are times but I want to restrict what users can do. I may not want them to think something is useful when it isn't. For example, a table of articles could contain a field representing tags/keywords. Each article would have multiple, equally-weighted keywords. I don't want users sorting on the first keyword displayed and garnering some insight into this.
Again, it's more of a preference and I like having the option to disable it on occasion. - John ************************************************** John Callahan, Research Scientist Delaware Geological Survey, University of Delaware URL: http://www.dgs.udel.edu ************************************************** On Wed, Nov 17, 2010 at 10:08 AM, David Karger <[email protected]> wrote: > I wonder about the importance of blocking the user from sorting on a > column. If it isn't useful, they won't do it---why explicitly prevent it? > > > On 11/17/2010 9:12 AM, John Callahan wrote: > > Thanks. That's the piece of code. However, I'm not sure I can simply put > field header names in there as this code base is used for numerous exhibits. > > I was thinking about adding a new parameter setting to the tabular view to > control whether sorting is used or not for that field. Something like > columnSort and would work similar to the other column settings: > > ex:columns = ".label, .name, .tags, .notes" > ex:columnLabels = "ID, Name, Keywords, Additional Notes" > ex:columnFormats = "list, list, list, list" > ex:columnSort = "1,1,0,0" > > "1" would represent to allow column sorting through clicking on the header, > "0" would not allow it. On the surface, this seems like a minimal change to > the code. Would it be beneficial to incorporate it? > > - John > > > PS - One of the advantages of disabling sorting for certain columns is > because there are some bugs in the tabular view sorting. For columns with > sorting problems, this can be disabled until the bugs get worked out. > > ************************************************** > John Callahan, Research Scientist > Delaware Geological Survey, University of Delaware > URL: http://www.dgs.udel.edu > ************************************************** > > > On Tue, Nov 16, 2010 at 6:15 PM, Jon Bogacki > <[email protected]>wrote: > >> Oops, I meant 'header1' || 'header2' etc >> >> On 17/11/2010, at 12:09 PM, Jonno B <[email protected]> wrote: >> >> > Hi John, the function you are looking for is >> > Exhibit.TabularView.createColumnHeader in tabular-view.js >> > >> > Something like the below should work. Replace 'column1' || 'colum2' >> > etc with the labels of the columns you do not want to be sortable. (I >> > haven't tested this): >> > >> > >> > Exhibit.TabularView.createColumnHeader = function( >> > exhibit, >> > th, >> > label, >> > sort, >> > sortAscending, >> > sortFunction >> > ) { >> > var l10n = Exhibit.TabularView.l10n; >> > var template = { >> > elmt: th, >> > className: sort ? >> > "exhibit-tabularView-columnHeader-sorted" : >> > "exhibit-tabularView-columnHeader", >> > title: sort ? l10n.columnHeaderReSortTooltip : >> > l10n.columnHeaderSortTooltip, >> > children: [ label ] >> > }; >> > if (sort) { >> > template.children.push({ >> > elmt: Exhibit.UI.createTranslucentImage( >> > sortAscending ? "images/up-arrow.png" : "images/down- >> > arrow.png") >> > }); >> > } >> > >> > if(label!= 'header1' || 'header2' || 'header3'){ >> > SimileAjax.WindowManager.registerEvent(th, "click", sortFunction, >> > null); >> > } >> > >> > var dom = SimileAjax.DOM.createDOMFromTemplate(template); >> > return dom; >> > }; >> > >> > >> > Regards, >> > Jon >> > >> > >> > >> > >> > On Nov 17, 6:03 am, John Callahan <[email protected]> wrote: >> >> Does anyone know of a way to disable onclick sorting for some of the >> column >> >> headers in the Exhibit Tabular view? I have tables where most of the >> >> columns should be sorted but not all. Is there maybe a js/jquery >> function >> >> that can "unregister" the onclick event from the column headers? >> Thanks. >> >> >> >> - John >> >> >> >> ************************************************** >> >> John Callahan, Research Scientist >> >> Delaware Geological Survey, University of Delaware >> >> URL:http://www.dgs.udel.edu >> >> ************************************************** >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "SIMILE Widgets" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> [email protected]<simile-widgets%[email protected]> >> . >> > For more options, visit this group at >> http://groups.google.com/group/simile-widgets?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "SIMILE Widgets" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<simile-widgets%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/simile-widgets?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "SIMILE Widgets" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/simile-widgets?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "SIMILE Widgets" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<simile-widgets%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/simile-widgets?hl=en. > -- You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en.
