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.
