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

Subscribe to our news:
Partners
Testimonials
Marco De Luca: "I can handle now both version of SQLite Databases, 2.x and 3.x. Your SQLite PHP Generator is among the best tools I have seen".
Svetlio Mitev: "I am really sure that you guys can make the best PHP code generators to be found worldwide".

More

Add your opinion

SQLite PHP Generator 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