Populate form with subset

Populate form with subset

nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
edited November 2012 in Editor
Hi Allan,
I want my editor to show only a subset of data for the user.
I.e. I only want to show the patients that belong to the currently logged in doctor (e.g. where f_UID = N)
I don't see any code for this in the examples / tutorials, but it seems to me that this would be a relevant use case.
Please point me in the right direction. Thanks.
Nathan

Replies

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin
    So basically a where condition on the data that is initially loaded? That can be done with the `where` method :-). http://editor.datatables.net/docs/current/php/class-DataTables.Editor.html#_where

    Example:

    [code]
    Editor::inst( $db, 'users' )
    ->where( 'userid', $_SESSION['userid'] )
    ...
    [/code]

    Allan
  • nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
    Thanks!
This discussion has been closed.