I want user to choose Jabatan first then, list of Unit will be display based on chosen Jabatan. Both Jabatn n Unit get from database. Im still working on it. Tried several code, but its not working.
This code is working fine but the Unit is already displayed without depending on Jabatan. This is not what i one.
Anyone.. could u pls help? Been working to get this working since last week.
<td>Jabatan*</td>
<td>:</td>
<td><?php
$selObj = new Select('jabatan', 'jabatan');
$selObj->addOption('', '---SILA PILIH--');
$selObj->setDataSource($DBQueryObj); //Check DBQuery object is correct.
$selObj->setDataSourceTableAdv('_kod_jabatan', 'kod_jab', 'perihal');
//$selObj->setFilterColumnAdv('COLUMN_NAME', 'FILTER VALUE', IFieldType::STRING_TYPE, IConditionOperator::NONE); //Comment if not using filter.
$selObj->setSortColumnAdv(ISortColumn::COLUMN_LABEL, ISortOrder::ASC);
$selObj->initBindingSelectAdv();
$selObj->setSelectedValue($jabatan); //Change default value.
$selField = $selObj->renderField();
echo $selField['fieldHTML'];
?></td>
</tr>
<tr>
<td>Unit*</td>
<td>:</td>
<td><?php
$selObj = new Select('unit', 'unit');
$selObj->addOption('', '---SILA PILIH--');
$selObj->setDataSource($DBQueryObj); //Check DBQuery object is correct.
$selObj->setDataSourceTableAdv('_kod_unit', 'kod', 'perihal');
//$selObj->setFilterColumnAdv('COLUMN_NAME', 'FILTER VALUE', IFieldType::STRING_TYPE, IConditionOperator::NONE); //Comment if not using filter.
$selObj->setSortColumnAdv(ISortColumn::COLUMN_LABEL, ISortOrder::ASC);
$selObj->initBindingSelectAdv();
$selObj->setSelectedValue($unit); //Change default value.
$selField = $selObj->renderField();
echo $selField['fieldHTML'];
?></td>
</tr>