Author Topic: ColModel return object  (Read 235 times)

hirehop

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
ColModel return object
« on: November 20, 2023, 09:27:43 pm »
In column model
Code: [Select]
filter: {                     
crules: [{condition: 'range'}],
gridOptions: {
stripeRows: false,
filterModel: {header: false}
},
options: [                 
{"": lang.allTxt},
{"0:1": "days <= 1"},
{"1:7": "1 < days <= 7"},
{"7:14": "7 < days <= 14"},
{"14:21": "14 < days <= 21"},
{"21:30": "21 < days <= 30"}
],
//override range compare.
conditions: {
range: {
compare: function (cellData, val) {
console.log("cellData", cellData, "val", val);
return true;
}
}
}
}

If cellData is an object it returns a [OBJECT OBJECT] (see red)....

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: ColModel return object
« Reply #1 on: November 21, 2023, 11:12:03 am »
That's correct, object remains an object in cellData.

Please check this example for how to deal with object cell data.

https://paramquery.com/pro/demos/json_nested