SQL VIEW example page, Editor PHP

SQL VIEW example page, Editor PHP

perrotinperrotin Posts: 39Questions: 9Answers: 1

The example page for Editor PHP is not working :

https://editor.datatables.net/examples/advanced/sqlView

Replies

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @perrotin ,

    Thanks for point that out - we're taking a nose at it now.

    Cheers,

    Colin

  • wireddunswiredduns Posts: 6Questions: 1Answers: 0

    Delete and Edit work fine, however New does not:

    data[0][first_name]=Mark
    data[0][last_name]=Donszelmann
    data[0][phone]=123456789
    data[0][city]=Amsterdam
    action=create

    results in no changes in the table and result:

    {
    "data": []
    }

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Thanks @wiredduns , we weren't aware of that. I've raised it internally (DD-1214 for my reference) and we'll report back here when there's an update.

    Cheers,

    Colin

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    So the issue is that I've got a condition on the VIEW to show of that the VIEW doesn't need to be a simple SELECT. But I hadn't set the value in the controller that allowed the new record to match that condition.

    In PHP the fix is to add:

            Field::inst( 'site' )
                ->get(false)
                ->setValue(4) // New York, for the VIEW condition
    

    to the Editor PHP instance (in the controller).

    Committed now and will be included in the next update.

    Thanks!
    Allan

This discussion has been closed.