Author Topic: Uncaught use treeOption() to set treeModel options.  (Read 1954 times)

resolvecomputing

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 40
    • View Profile
Uncaught use treeOption() to set treeModel options.
« on: March 12, 2018, 02:10:31 pm »
Dear team
When i change data i call to pq.grid() with new data i have this message "Uncaught use treeOption() to set treeModel options.", and when i select input selected i call again and then issue came again. i don't know why? Please help me. follow my code at this link https://plnkr.co/edit/0yb0Nk5AvOcHEXAjPLMI?p=preview . You can see the error message in console of browse.
Thank you so much!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: Uncaught use treeOption() to set treeModel options.
« Reply #1 on: March 12, 2018, 09:15:59 pm »
There is a need to destroy the grid before passing a completely new set of options.

Code: [Select]
$('#change-data').change(function() {
    var reportDate = $(this).val();

    var obj = gridView(reportDate=="data1"?data1: data2);

    $("#coa-table-tree").pqGrid('destroy')

    pq.grid("#coa-table-tree", obj);
})

https://plnkr.co/edit/xZvUTEnM39JouKRaOQ6J?p=preview