Author Topic: Uncaught dataIndx NA  (Read 9182 times)

webifi

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 45
    • View Profile
Uncaught dataIndx NA
« on: December 09, 2014, 09:35:03 am »
I notice that I intermittently get an "Uncaught dataIndx NA" error reported in the console when clicking to collapse a detailModel, and the detail does not collapse correctly.  (The parent row disappears and the "detail" stays visible.)   Is this a known issue?
« Last Edit: December 09, 2014, 09:37:59 am by webifi »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6275
    • View Profile
Re: Uncaught dataIndx NA
« Reply #1 on: December 09, 2014, 02:31:04 pm »
Please follow the following demos and share a jsfiddle if still facing issues.

http://paramquery.com/pro/demos/nesting

and

http://paramquery.com/pro/demos/detail
« Last Edit: December 09, 2014, 02:46:04 pm by paramquery »

webifi

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Uncaught dataIndx NA
« Reply #2 on: December 09, 2014, 09:08:21 pm »
Trying to get a jsfiddle set up to re-create the problem there, but keep getting a "Can't read property "find" of undefined" when expanding a detail:

http://jsfiddle.net/znskyo75/1/


Edit:

Got the jsfiddle working... still trying to get it to replicate the problem...

Edit2:

I'm still trying to get the "Uncaught dataIndex NA" to trigger, but here's another somewhat related issue:
http://jsfiddle.net/znskyo75/4/

Try to expand a detail, then collapse it.   When a longer detail's parent row gets focus by clicking on its detail arrow column, the parent row scrolls out of view and doesn't hide the child.
« Last Edit: December 09, 2014, 09:45:52 pm by webifi »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6275
    • View Profile
Re: Uncaught dataIndx NA
« Reply #3 on: December 09, 2014, 09:46:29 pm »
This is the corrected one.

http://jsfiddle.net/znskyo75/3/

I found 2 issues with your implementation:

you were using same variable name for outer and inner grid i.e., $grid.

and you were not returning $grid2 in detailModel.init callback.

webifi

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Uncaught dataIndx NA
« Reply #4 on: December 09, 2014, 10:12:46 pm »
Thanks.  Caught the missing return just after I posted it.

The variable $grid re-declaration doesn't happen in my private code (nor did it seem to trigger the "Uncaught dataIndx NA" issue) -- but I'm searching my private/non-jsfiddle code again for possible similar mistakes.  Do you know what pqGrid would be looking for when it throws such an error?  It may help me narrow down where the issue is.

Please take a look at my edit above, as it highlights another issue I'm having.  (Let me know if you'd like me to post that in a different thread.)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6275
    • View Profile
Re: Uncaught dataIndx NA
« Reply #5 on: December 09, 2014, 11:11:29 pm »
Thanks for pointing out the other scrolling issue, would possibly be taken care of in next version.

The grid throws "dataIndx NA" error if it doesn't find dataIndx of a column.

webifi

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Uncaught dataIndx NA
« Reply #6 on: December 09, 2014, 11:31:41 pm »
Thanks, I look forward to a fix for the focus/scrolling issue.

I'm still having trouble replicating the "Uncaught dataIndx NA" issue on jsfiddle, but I think it may be related to the focus/scrolling issue.  This jsfiddle visually acts like the "Uncaught dataIndx NA" issue, but doesn't throw the error:

See:
http://jsfiddle.net/znskyo75/6/

Open the dialog.  Expand first detail.  Expand that detail's detail.  Try to collapse the nested detail.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6275
    • View Profile
Re: Uncaught dataIndx NA
« Reply #7 on: December 10, 2014, 10:42:58 am »
virtual mode for the outer and inner grids fixes all the aforementioned issues.

http://jsfiddle.net/znskyo75/8/

webifi

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Uncaught dataIndx NA
« Reply #8 on: December 10, 2014, 08:13:57 pm »
That "fix" doesn't seem to make the nested grids any more usable.  Am I missing something?

For example:
Try expanding the last item's detail, then that detail's detail.  Now try scrolling to the bottom.

Edit:
To clarify,  it is desired to only have a vertical scrollbar on the outermost grid, and to have a continuous scroll (not a jump between rows).
« Last Edit: December 10, 2014, 08:19:26 pm by webifi »

webifi

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Uncaught dataIndx NA
« Reply #9 on: December 10, 2014, 10:54:53 pm »
I'm a little confused by that last reply of "virtual mode for the outer and inner grids fixes all the aforementioned issues".

Does this mean you have no plans on fixing the issues described?

"virtual mode" does not fix all the issues for me.   It creates many new ones.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6275
    • View Profile
Re: Uncaught dataIndx NA
« Reply #10 on: December 10, 2014, 11:18:47 pm »
Your feedback is quite important, that helps us to improve the grid with every version.

I understand that you want to use scrolling only for the outer grid, no scrolling for inner grids and your inner nested grids may exceed  the view port of outer one.

In this regard non virtual mode would be fixed w.r.t the discussed issues and I guess that's what you need.

As far as virtual mode is concerned, it works the way as designed. It scrolls by row and column units similar to Excel. There is no immediate plan to alter it. In virtual mode, nesting is only useful either by using scrolling or paging for inner grids so that they don't exceed the view port of outer grid.
« Last Edit: December 11, 2014, 04:00:18 pm by paramquery »

webifi

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Uncaught dataIndx NA
« Reply #11 on: February 01, 2015, 09:05:08 pm »
As a temporary work-around, the following css seems to fix the collapsing issue on nested grids (when I use the grids in a dialog):

.ui-dialog-content>.pq-grid>div>div>div>div>.pq-grid-table .pq-grid-table {
    margin-top: 0px !important;
}

If not using a dialog, replace .ui-dialog-content with a selector for the outermost container of the grid(s).