Author Topic: Using loadState in grouped fields  (Read 227 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 163
    • View Profile
Using loadState in grouped fields
« on: March 10, 2025, 04:10:13 pm »
Hello,

I have a grid where I group some columns using ParamQuery Grid. I grouped the columns in colModel again using colModel.

For example, I created a group called "Dates". Then I moved the column "Order Date" into it. However, when I try to save and restore this change, I get an error.

In some cases, I get the error "p is undefined".



https://jsfiddle.net/5j760ehL/3/
Code: [Select]
    {
      title: "Dates",
      align: "center",
      dataIndx: "grupDates",
      hidden: false,
      colModel: [
        {
          title: "Required Date",
          width: 100,
          dataIndx: "RequiredDate",
          dataType: "date",
        },
        {
          title: "Shipped Date",
          width: 100,
          dataIndx: "ShippedDate",
          dataType: "date",
        },
      ],
    }


Error line: ParamQuery 10.1.0 line 5585
Code: [Select]
m && (v.parentId != m.parentId && (p = s[v.parentId], g = s[m.parentId]) && (p.colModel.splice(p.colModel.indexOf(v), 1), g.colModel.push(v)), this._saveState(m, v, u))


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6373
    • View Profile
Re: Using loadState in grouped fields
« Reply #1 on: March 11, 2025, 03:19:33 pm »
Is there any particular sequence of events which cause the error.

I've clicked the saveState and loadState buttons a couple of times while continuously changing various grid options, such as the group-by column, order of columns, page number, etc., but I haven't been able to reproduce the error so far.