SQL VIEW example page, Editor PHP

SQL VIEW example page, Editor PHP

perrotinperrotin Posts: 36Questions: 8Answers: 1

The example page for Editor PHP is not working :

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

Replies

  • colincolin Posts: 9,856Questions: 0Answers: 1,635

    Hi @perrotin ,

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

    Cheers,

    Colin

  • wireddunswiredduns Posts: 1Questions: 0Answers: 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: 9,856Questions: 0Answers: 1,635

    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: 52,724Questions: 1Answers: 8,070 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

Sign In or Register to comment.