Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Jonathan Oakes: "This is a lovely application. It's easy to hook into my own bespoke applications. It's very powerful, yet really quite simple to use. Thanks for this".
Kirby Foster: "Nice software. Small, lightweight, works well. I evaluated lots of software before deciding that your software worked the best for what I do. Both Maestro for MySQL and PHP Generator have saved me lots of time".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

clear

Deletes all elements in a checkbox group or a multiple select.

 

Signature:

function clear()

 

Example:

The code below placed in the OnInsertFormEditorValueChanged and OnEditFormEditorValueChanged changes the content of the 'Clothes' checkbox group depending of the selected season.

 

if (sender.getFieldName() == 'season') 

{

 var $item_count = editors['clothes'].getItemCount(); 

 if ($item_count == 6)

   {

    if (sender.getValue() == 'Winter')

       {

       editors['clothes'].removeItem('Shorts');

       editors['clothes'].removeItem('Sandals');

       editors['clothes'].removeItem('Swimsuit');

       }

    else

    {

      editors['clothes'].removeItem('Coat');

      editors['clothes'].removeItem('Boots');

      editors['clothes'].removeItem('Cap');

    }

  }

  else

  {

    editors['clothes'].clear();

    if (sender.getValue() == 'Winter')

       {

       editors['clothes'].addItem('Coat','Coat');

       editors['clothes'].addItem('Boots','Boots');

       editors['clothes'].addItem('Cap','Cap');  

       }

    else

    {

       editors['clothes'].addItem('Shorts','Shorts');

       editors['clothes'].addItem('Sandals','Sandals');

       editors['clothes'].addItem('Swimsuit','Swimsuit');

    }

  }

 

The screenshot demonstrates the result of the fired event.

 

 

See also: addItem, removeItem, getItemCount



Prev Return to chapter overview Next