• Resolved thierrySN

    (@thierrysn)


    Hi,
    I use
    $table_id=29;
    $table = TablePress::$model_table->load( $table_id );
    to get a specific table and I wish to modify a cell (line 0 and col 0 …for example)
    So, I suppose I’ve to write something like that:
    $table[‘data’][0][0]=’xxxx’;
    …the question is: how can I update TablePress ?

    Thanks

    Thierry

    https://www.ads-software.com/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Yes, that’s the correct way. To update the table, you’d now have to save it. I suggest that you take a look at how TablePress does this, e.g. in https://github.com/TobiasBg/TablePress/blob/master/controllers/controller-admin_ajax.php#L125

    The relevant line is

    $saved = TablePress::$model_table->save( $table );

    Regards,
    Tobias

    Thread Starter thierrySN

    (@thierrysn)

    Thanks
    It’s work
    By the way, where can I find a complete documentation about TablePress class ?

    Regards

    Thierry

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    there’s no real documentation of the code, mainly because these functions are not really designed as a public API. (Thus, there’s no guarantee that the code won’t change in the future.)
    You will have look through the actual code with its inline documentation for more information on it.

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to modify a cell with Php’ is closed to new replies.