Author Topic: Merge Cell with dynamic row  (Read 330 times)

hirehop

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Merge Cell with dynamic row
« on: May 18, 2023, 09:00:34 pm »
Hello
I have tried to get dynamic row index to merge cell and value is as per needed but its not working.

my function for get dynamic row value as per below
Code: [Select]
complete: function()
      {
            var data = that.grid.pqGrid("pageData"),
                  merged = [];
            if(!empty(data) )
           {
              $.each(data, function(i,row)
               {
      if(typeof(row["children"])!=="undefined")
      {
    merged.push({r1:i, c1:0, rc:1, cc:3});
       }
                });
           }
           that.grid.pqGrid( "option", "mergeCells",merged);
     },


resopnse as at console from loop in screeshot.


Thank You....

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Merge Cell with dynamic row
« Reply #1 on: May 18, 2023, 09:56:45 pm »
you need to call grid.refreshView() after setting mergeCells option.

hirehop

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Merge Cell with dynamic row
« Reply #2 on: May 22, 2023, 02:40:55 pm »
Thanks a lot.
its working very good.