Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Example of using the mjoinMinCount validation

$
0
0

Hi!

I'm struggling to understand how to use the new Validate:mjoinMinCount() validation. Reading the manual this was my best guess of how to use it but this does not validate:

 ->join(
            Mjoin::inst( 'genres' )
                ->validator('genres[].id', Validate::mjoinMinCount(1))
                 ->link( 'contacts.id', 'contacts_genres.contact_id' )
                 ->link( 'genres.id', 'contacts_genres.genre_id' )
                 ->order( 'genres.genre asc' )
                 ->fields(
                     Field::inst( 'id' )
                          ->validator(Validate::required())
                          ->options( Options::inst()
                                            ->table( 'genres' )
                                            ->value( 'id' )
                                            ->label( 'genre' )
                      ),
                     Field::inst( 'genre' )
                 )
        )

Could you point me in the right direction?

Thanks!


Viewing all articles
Browse latest Browse all 1816

Latest Images

Trending Articles



Latest Images