Issue with oColumnFilterWidgets and a JSON Array in aaData

Issue with oColumnFilterWidgets and a JSON Array in aaData

KrisKris Posts: 4Questions: 0Answers: 0
edited September 2012 in General
I provide a custom JSON array to aaData which is rendered very well through aoColumns / mData but when using oColumnFilterWidgets, it makes an error "Uncaught TypeError: Cannot read property 'length' of undefined" which is corresponding to the line 61 in the source file:
"if (bIgnoreEmpty == true && sValue.length == 0) continue;"

The error comes obviously from sValue which has been assigned var sValue = aData[iColumn]; and I guess that iColumn is a number while in my case, it should be the name of the column (because we are in a JSON Array.)

I don't know if I missed a parameter somewhere or if it's a real bug.

Help is very much appreciated :)

Replies

  • KrisKris Posts: 4Questions: 0Answers: 0
    Ok, I fixed the plugin by converting the iColumn to my JSON key by including that before:
    [code]
    if(iColumn==0)
    iColumn = 'Name';
    else if(iColumn==1)
    iColumn = 'BillingStreet';
    else if(iColumn==2)
    iColumn = 'BillingCity';
    else if(iColumn==3)
    iColumn = 'BillingCountry';
    else if(iColumn==4)
    iColumn = 'Phone';
    else if(iColumn==5)
    iColumn = 'Chechbox';
    [/code]

    weird static fix, but at least working...
This discussion has been closed.