Author Topic: linked/url columns break when grouped  (Read 7591 times)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: linked/url columns break when grouped
« Reply #15 on: April 21, 2020, 10:34:11 pm »
ui.obj inside selectGridObj points to initialization object of pqgrid in filter dropdown.

Code: [Select]
        filter: {
          selectGridObj: function(ui) {           
            ui.obj.colModel[0].renderLabel = function(ui2) {
              if (ui2.cellData) {
                var aval = ui2.cellData.split(':::');
                return aval[1];
              }
            }
          }
        }

https://jsfiddle.net/wqjo91xv/

gmswsd

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: linked/url columns break when grouped
« Reply #16 on: April 21, 2020, 11:01:32 pm »
Thanks Paramvir,
That worked perfectly.

gmswsd

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: linked/url columns break when grouped
« Reply #17 on: April 23, 2020, 04:45:35 am »
Hi Paramvir,
That worked when the links where the same, however if the links are different it then groups and filters by the whole line.
Is it possible to sort on Link Text and not the url?
So it would group all nba together even though they have different urls.
        var data = [
            [1, 'Celtics',"nba.com/celtics:::nba", 339938.0, 36130.0],
            [2, 'Blazers',"espn.com:::espn" , 315654.0, 11231.0],
            [3, 'Pistons',"nba.com/pistons:::nba" , 9954.0, 11231.0],
            [2, 'Raptors',"nba.com/raptors:::nba" , 9954.0, 11231.0]
        ];
https://jsfiddle.net/763518cL/

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: linked/url columns break when grouped
« Reply #18 on: April 23, 2020, 02:17:54 pm »
Quote
Is it possible to sort on Link Text and not the url?

Grouping takes place by cell data content rather than cell renderers so you need to reorder the data such that link text is placed before url.

something like "nba:::celtics/nba.com"

gmswsd

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: linked/url columns break when grouped
« Reply #19 on: April 23, 2020, 07:22:19 pm »
Thanks Paramvir,
Unfortunately, still doesn't group properly.
There was no difference putting it the way you suggested "nba:::celtics/nba.com"
https://jsfiddle.net/WebSalesDesign/hx1kz6fc/1/

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: linked/url columns break when grouped
« Reply #20 on: April 23, 2020, 10:30:52 pm »
Ok, if you mean to group "nba" together like

nba (3)
espn (1)

then you need to keep data like

Code: [Select]
var data = [
            [1, 'Celtics', "nba", "nba.com/celtics:::nba", 339938.0, 36130.0],
            [2, 'Blazers', "espn", "espn.com:::espn" , 315654.0, 11231.0],
            [3, 'Pistons',"nba", "nba.com/pistons:::nba" , 9954.0, 11231.0],
            [2, 'Raptors', "nba", "nba.com/raptors:::nba" , 9954.0, 11231.0]
        ];

keep the 4th column hidden and use values from 4th column in the renderer of 3rd column.

gmswsd

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: linked/url columns break when grouped
« Reply #21 on: April 27, 2020, 10:01:48 pm »
Hi, I made the render the link column and it groups the way I want, but then it just shows the information from "subject" and not the "subject-word" information that I want it to show. It also is not a clickable link anymore. Is there a way to have it group the way I want, and show the information from 'subject-word' and be a clickable link?

https://jsfiddle.net/xvpu03kb/

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: linked/url columns break when grouped
« Reply #22 on: April 28, 2020, 11:02:21 am »
I guess we already covered how to use render and renderLabel callbacks in the previous posts, only difference now being that data has to be used from another column.

Is there a change in your requirements.

Can you please share a screenshot of the way you want to display data.