0

I am using zend with jqxgrid.

While navigating to the page(eg: test.com/employee) containing jqxgrid, the grid simply works and loads the required data to the grid.

But when I try to navigate the same page by passing the parameter(eg: test.com/employee/id/1), the grid doesnot load. I’ve used loadError on the dataAdapter as below and printed the error

var dataadapter = new $.jqx.dataAdapter(source,{
loadError: function (xhr, status, error) { alert(‘Status=’+status+’, Error=’+error); }
});

The result of the alert is shown as: “Status=parsererror, Error=SyntaxError: JSON.parse: unexpected character”

I want to load the grid according to the “id” passed through navigation URL but its not working. So, what is the solution to this problem?

Does the jqxgrid takes the parameter /id/1 from the navigation URL while calling ajax?

Thank you in advance.

KCP
  • 929
  • 9
  • 29

2 Answers2

0

Check your JSON output. There is a difference in it for each case. If could be that your JSON is invalid:

  • One character before
  • One character after
  • A BOM character somewhere there
  • Your JSON is NOT UTF-8?
Borislav Sabev
  • 4,776
  • 1
  • 24
  • 30
  • 1
    Thanks Borislav Sabev for your answer. But I found the error. It was due to routing error on zend – KCP Sep 18 '13 at 08:29
0

This was due do the routing error.

When I replaced the navigation URL test.com/employee/id/1 with test.com/employee?id=1 , it worked as expected.

KCP
  • 929
  • 9
  • 29