Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
230
igHierarchicalGrid json error
posted

Getting this error when escaping / in json

error message  there was an error parsing/evaluating the JSON string: Unexpected token /  when escaping of special characters 
infragistics.datasource.js:36

 in database users where storing dates like this 10/07 in a text field I escaped the /  so json looks like this

{"id":"64198","site_id":"263","room_id":"90","guardian_id":"29496","active":"A","child_first_name":"Jordan 10\/07","child_middle_initial":"","child_last_name":"Jackson","child_full_name":"JACKSON, JORDAN 10\/07","child_ssn":"","child_date_of_birth":"2007-10-05 00:00:00","child_approx_date_of_birth":"0","older_infant":"0","class_room":"3-4 YR B","ethnicity":"","has_breakfast":"0","has_lunch":"0","has_snack":"0","has_am_supplement":"0","has_dinner":"0","has_pm_supplement":"0","created_date":"2007-12-11 00:00:00","created_time":"120008","created_by":"GLADYS","updated_date":"2012-07-19 00:00:00","updated_time":"094504","updated_by":"GLADYS"}

using hgrid like this

$.ig.loader(function () {
var jsonp = new $.ig.JSONDataSource({ dataSource: "/childcare/Sites/api_index.json", datatype: "jsonp", callback: "render", responseDataKey: "" })

$("#grid1").igHierarchicalGrid({
autoGenerateColumns: false,
autoGenerateLayouts: false,
caption: "Sites",
expandCollapseAnimations: true,
animationDuration: 1000,
initialDataBindDepth: -1,
dataSource: jsonp,
dataSourceType: "json",
responseDataKey: "",
width: "98%",
primaryKey: "id",
columns: [...

thanks in advance

  • 5105
    Offline posted

    Hi there,

    Could you tell us which version of the Ignite UI product you are using and also if possible, could you attach a zip file with a sample isolating the issue. This would allow us to look at it much quicker. Thanks a lot in advance!