DataTable server side for Symfony 2 (Doctrine)

DataTable server side for Symfony 2 (Doctrine)

slauta93slauta93 Posts: 1Questions: 0Answers: 0
edited July 2012 in General
Hi!

I then wrote the code for the sample from the database under the Doctrine, it may be useful)

https://gist.github.com/3175255 or ver. 2 https://gist.github.com/3175282

P.S. Sorry for my English

Replies

  • QuentinQuentin Posts: 21Questions: 0Answers: 0
    Hello !

    Thank you for providing us your code.
  • QuentinQuentin Posts: 21Questions: 0Answers: 0
    Well... I can't get it to work.

    I use normal routing via yml files, so just putted your routes in the file instead of using SensioFrameworkExtraBundle.

    Datatables is saying that there is a JSON formatting error.

    Can you explain a bit your code ?

    Thank you.
  • allanallan Posts: 48,281Questions: 1Answers: 6,967 Site admin
    I don't know much about slauta93's framework, but I would say that knowing what the server is returning would be very helpful to anyone who can help you with this problem (i.e. what is it returning other than valid JSON - my guess is an error that would lead to the problem).

    Allan
  • QuentinQuentin Posts: 21Questions: 0Answers: 0
    Sure.

    I have made a debug and saw that there was no json returned, because there was no valid routes found by Symfony2. And with a valid route, there is no json but the page itself returned...

    So the sAjaxSource is wrong and i don't understand why... I will continue to learn more about routes in Symfony2 maybe...
  • QuentinQuentin Posts: 21Questions: 0Answers: 0
    ...

    I solved my problem, just had to give the namespace when using the path to the entity repository.

    Example:
    [code]
    mynamespaceMyBundle:MyEntity
    [/code]

    :)
This discussion has been closed.