Author Topic: Show/hide column has display <span> tag  (Read 2544 times)

Jignesh

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 46
    • View Profile
Show/hide column has display <span> tag
« on: December 27, 2019, 12:14:26 pm »
Hi Paramvir,


I have attached screenshot where I have detailed about issue. Please let me know how to remove/hide span tag.


Thanks,
Cherish Patel

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Show/hide column has display <span> tag
« Reply #1 on: December 27, 2019, 10:42:23 pm »
I understand you have used span tag to add title to the column, html tags in the header cause issue with sorting too, so not recommended.

Please use getCellHeader method in refreshHeader event to add title instead of span tag.

Code: [Select]
refreshHeader: function(){
this.getCellHeader(params...).attr("title", "Description");
}

https://paramquery.com/pro/api#method-getCellHeader

--------------------

In version 7.0, it's much easier to add title with newly introduced attrHead property of column.

Code: [Select]
{
 attrHead: 'title="Description"',
 ..
}

https://paramquery.com/pro/api#option-column-attrHead
« Last Edit: December 27, 2019, 10:44:40 pm by paramvir »

Jignesh

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Show/hide column has display <span> tag
« Reply #2 on: January 01, 2020, 04:21:40 pm »
Hi Paramvire,

I have set discription on tooltip of header column label as attached in previous screenshot. Column Title has display properly. Please read my previous post on same.


Thank you

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Show/hide column has display <span> tag
« Reply #3 on: January 02, 2020, 03:42:53 pm »
By title I meant title attribute of span element which you have used to add tooltip to header cell.

Anyway if you want to keep using span element, please add gridOptions sub-option to menuUI option as below to fix the issue faced by you:

Code: [Select]
menuUI:{
gridOptions:{
columnTemplate:{dataType:'html'}
}
},

takao.sohara

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Show/hide column has display <span> tag
« Reply #4 on: May 27, 2020, 01:47:05 pm »
Thank you. I was able to solve it safely.