Author Topic: When rowSpanHead mode is set to true, sorting functionality is not working  (Read 372 times)

YONGHOO KIM

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 20
    • View Profile
Hi !
When the header row in a grid consists of multiple rows, and you set the rowSpanHead mode to true, it's expected behavior that only the columns in the final row of the header will be sortable.
How can I enable sorting functionality for columns other than the final row's column ?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: When rowSpanHead mode is set to true, sorting functionality is not working
« Reply #1 on: September 26, 2023, 07:49:50 am »
It would be fixed in upcoming version.

This patch can be used for now to fix it

Code: [Select]
pq.cRenderHead.prototype.onHeaderCellClick=function(e,t,s){e=e||{};var l=this.that,i=l.options,r=i.sortModel,a=i.selectionModel,o=$(s.target),d=e.dataIndx;if(!1!==l._trigger("headerCellClick",s,{column:e,colIndx:t,dataIndx:d})&&-1!=t&&!o.closest(".pq-grid-header-search-row")[0]){if(a.column&&a.type&&!o.hasClass("pq-title-span")&&!o.hasClass("ui-icon")){var n=l.getFirstVisibleRIP(),c={c1:t,firstC:t,firstR:n},p=l.iSelection,u=p.address(),C=u.length;if(pq.isCtrl(s))p.add(c);else{if(s.shiftKey){if(C&&"column"==u[C-1].type){var f=u[C-1];f.c1=f.firstC,f.c2=t,f.r1=f.r2=f.type=f.cc=void 0}c=u}l.Range(c,!1).select()}null!=(n=l.getFirstVisibleRIP(!0))&&(l.focus({rowIndxPage:n,colIndx:t}),l._trigger("mousePQUp"))}else(r.wholeCell||o.hasClass("pq-title-span"))&&l.isSortable(e)&&l.sort({sorter:[{dataIndx:d,sortIndx:e.sortIndx}],addon:!0,skipCustomSort:pq.isCtrl(s),tempMultiple:r.multiKey&&s[r.multiKey],evt:s})}};