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".
Lucian Nedescu: "Thank you very much. Have a nice century (this is a real wish :P). I think that i will do a great job on my clients database with the new php interface. Thank You again".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

getItemCount

Returns the number of checkbox group or a multiple select elements.

 

Signature:

function getItemCount()

 

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: removeItem, addItem, clear



Prev Return to chapter overview Next