[autocomplete] Problems with empty results and JSON

[autocomplete] Problems with empty results and JSON


Hi!
I have played around with Jörns autocomplete a lot recently and like
it a lot. I hope for a more robust implementation soon with full
support for JSON and some other things discussed here and on the
plugins homepage.
I have followed the undocumented example of emails to implement my
autocomplete with JSON-resultset given from the server but have
problems with dealing with empty sets [] since I the formatItem fails
if "row" is undefined. I have trapped that in a if-clause but no
matter what I substitute it with it either generates a list of my
inserted string, or it breaks the regexp in the plugin.
formatItem: function(row) {
    if ( row !== undefined ) {
        var size = (row.size == "N/A" || row.size == "" || row.size == null
|| row.size == "null" || row.size == undefined) ? "" : "[" + row.size
+ "]";
        return row.itemNum + ", (" + row.extracode + ") " + row.brand + " "
+ row.shortDesc + " " + size;
    } else {
        return "No items...";
    }
generates a list of the limit amount of duplicate entries saying "No
items...".
I don't know why this is happening, nor how I can prevent it. Jörns
example don't suffer from this but I can not see what the difference
is.
Please assist me in this and tell me if you need more code to
understand this problem.
// christian