Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81916

Error when editing row with natural key containing @

$
0
0

When using a Natural Key such as an email address, the editor sends the data ok:

{
    action:"edit"
    data:{name@oldaddress.com:
        {user_ID: "999999999", email_ID: "name@newaddress.com"}
    }
}

The server updates the the email address and responds to the client with:

{
    data: [
        {email_ID: "name@newaddress.com", odr: "1", dft: "0", verified: "1"}
    ]
}

All good so far.

HOWEVER, when parsing the returned data, datatables issues the following error:

datatables.min.js:14 Uncaught Error: Syntax error, unrecognized expression: #name@oldaddress.com

Testing:

If the email address has a backslash inserted before the @, then the error goes away so:

name\@oldaddress.com - CAN BE UPDATED FINE
name@oldaddress.com - THROWS ERROR IN THE CLIENT

Is the solution to this to have Datatables escape the '@' symbol?


Viewing all articles
Browse latest Browse all 81916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>